• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Audit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Audit的典型用法代码示例。如果您正苦于以下问题:PHP Audit类的具体用法?PHP Audit怎么用?PHP Audit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Audit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: testPrepare

 public function testPrepare()
 {
     $this->_initSequenceTables();
     // test audit first
     $audit = new Audit();
     $audit->_ormPersist = true;
     $audit->objectClass = 'StdClass';
     $audit->persist();
     $this->assertTrue($audit->auditId > 0, 'Audit: Failed to persist');
     if ($audit->auditId > 0) {
         $audit->setPersistMode(WebVista_Model_ORM::DELETE);
         $audit->persist();
     }
     $auditValue = new AuditValue();
     $auditValue->_ormPersist = true;
     $auditValue->key = 'Key';
     $auditValue->value = 'Value';
     $auditValue->persist();
     $this->assertTrue($auditValue->auditValueId > 0, 'AuditValue: Failed to persist');
     if ($auditValue->auditValueId > 0) {
         $auditValue->setPersistMode(WebVista_Model_ORM::DELETE);
         $auditValue->persist();
     }
     if ($this->_autoLoggedIn) {
         $this->_setupAutoLogin();
     }
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:27,代码来源:TestCase.php


示例2: logAudit

 public static function logAudit($entity, $action, $description)
 {
     $audit = new Audit();
     $audit->date = date('Y-m-d');
     $audit->description = $description;
     $audit->user = Confide::user()->username;
     $audit->entity = $entity;
     $audit->action = $action;
     $audit->save();
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:10,代码来源:Audit.php


示例3: action_logs

 public function action_logs($page = 1)
 {
     if (!$this->getAuth()->hasAccess('maccess.admin')) {
         return $this->redirectToAdmin();
     }
     $this->param_manager->setParam('method_title', [_i('Audit'), _i('Logs')]);
     if ($page < 1 || !ctype_digit((string) $page)) {
         $page = 1;
     }
     $logs = $this->audit->getPagedBy('id', 'desc', $page);
     $this->builder->createPartial('body', 'moderation/audit_log')->getParamManager()->setParams(['logs' => $logs, 'page' => $page, 'page_url' => $this->uri->create('admin/moderation/logs')]);
     return new Response($this->builder->build());
 }
开发者ID:voh,项目名称:FoolFuuka,代码行数:13,代码来源:Moderation.php


示例4: addDbAuditLogEntry

 function addDbAuditLogEntry($action, $class, $id)
 {
     if ($class != "Audit") {
         $log = new Audit($this->w);
         $log->module = $this->w->currentModule();
         $log->submodule = $this->w->currentSubModule();
         $log->action = $this->w->currentAction();
         $log->path = $_SERVER['REQUEST_URI'];
         $log->ip = $this->w->requestIpAddress();
         $log->db_action = $action;
         $log->db_class = $class;
         $log->db_id = $id;
         $log->insert();
     }
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:15,代码来源:AuditService.php


示例5: hookExpiredSession

 public static function hookExpiredSession($sessionContents)
 {
     if (session_decode($sessionContents)) {
         if (Zend_Auth::getInstance()->hasIdentity()) {
             $identity = Zend_Auth::getInstance()->getIdentity();
             $audit = new Audit();
             $audit->objectClass = 'Logout';
             $audit->userId = (int) $identity->personId;
             $audit->message = __('user') . ': ' . $identity->username . ' ' . __('was logged out due to session expiration');
             $audit->dateTime = date('Y-m-d H:i:s');
             $audit->_ormPersist = true;
             $audit->persist();
         }
     }
 }
开发者ID:lucianobenetti,项目名称:clearhealth,代码行数:15,代码来源:Logout.php


示例6: testUserLoggedOut

 public function testUserLoggedOut()
 {
     $this->_objects = GeneralAlertHandler::generateUserLoggedOut();
     $objects = array();
     $db = Zend_Registry::get('dbAdapter');
     $audit = new Audit();
     $audit->_ormPersist = true;
     $audit->objectClass = 'Logout';
     $audit->objectId = 0;
     $audit->dateTime = date('Y-m-d H:i:s');
     $audit->type = WebVista_Model_ORM::REPLACE;
     $audit->userId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
     $audit->persist();
     $objects['audit'] = $audit;
     $clinicalNote = new ClinicalNote();
     $clinicalNote->personId = $this->_objects['person']->person_id;
     $clinicalNote->visitId = 100;
     $clinicalNote->clinicalNoteDefinitionId = 19;
     $clinicalNote->dateTime = date('Y-m-d H:i:s');
     $clinicalNote->eSignatureId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
     $clinicalNote->persist();
     $objects['clinicalNote'] = $clinicalNote;
     $eSign = new ESignature();
     // cleanup all generalAlerts
     $db->query('DELETE FROM ' . $eSign->_table);
     $eSign->dateTime = date('Y-m-d H:i:s');
     $eSign->signedDateTime = '0000-00-00 00:00:00';
     $eSign->signingUserId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
     $eSign->objectId = $clinicalNote->clinicalNoteId;
     $eSign->objectClass = get_class($clinicalNote);
     $eSign->summary = ' **Unsigned**';
     $eSign->persist();
     $objects['eSignature'] = $eSign;
     // cleanup all generalAlerts
     $generalAlert = new GeneralAlert();
     $db->query('DELETE FROM ' . $generalAlert->_table);
     $process = Processingd::getInstance();
     $process->clearProcesses();
     $process->addProcess(new ProcessAlert());
     $process->startProcessing(false);
     $generalAlertIterator = $generalAlert->getIterator();
     $ctr = 0;
     foreach ($generalAlertIterator as $alert) {
         $objects['generalAlert' . $ctr++] = $alert;
     }
     $this->assertEquals($ctr, 1, 'No alert created even with signed items');
     $this->_cleanUpObjects($objects);
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:48,代码来源:GeneralAlertTest.php


示例7: getInstance

 /**
  * @param Registry $registry
  * @return Audit
  */
 public static function getInstance($registry)
 {
     if (empty(Audit::$instance)) {
         Audit::$instance = new Audit($registry);
     }
     return Audit::$instance;
 }
开发者ID:ralfeus,项目名称:moomi-daeri.com,代码行数:11,代码来源:audit.php


示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $save = $this->category->create(Input::all());
     //store the logs
     Audit::store('Settings', 'Added a new category with an id of ' . $save->id);
     return Redirect::to('/categories')->with(['flash_message' => 'Category has been saved.', 'flash_type' => 'alert-success', 'title' => 'Category list', 'categories' => $this->category->all()]);
 }
开发者ID:fagray,项目名称:fposs,代码行数:12,代码来源:CategoriesController.php


示例9: addPlugin

 private function addPlugin()
 {
     $audit = \Audit::instance();
     $this->f3->scrub($_POST);
     $this->f3->set('SESSION.flash', array());
     // process form if > 0 plugins have been selected
     if ($this->f3->exists('POST.plugins') && count($this->f3->get('POST.plugins')) > 0) {
         foreach ($this->f3->get('POST.plugins') as $package) {
             // validate plugin
             if ($this->plugins->getPackage($package) !== false) {
                 $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => '"' . $package . '" is already installed. Skipping.'));
             } else {
                 if (!($config = $this->plugins->getRemoteConfig($package))) {
                     $this->f3->push('SESSION.flash', array('type' => 'danger', 'msg' => '"' . $package . '" could not be installed. (missing mytcg.json config file)'));
                 } else {
                     if (!isset($config['name']) || !isset($config['author']) || !isset($config['version']) || !isset($config['description'])) {
                         $this->f3->push('SESSION.flash', array('type' => 'danger', 'msg' => '"' . $package . '" could not be installed. (invalid mytcg.json config file)'));
                     }
                 }
             }
             // process install if there are no errors
             if (count($this->f3->get('SESSION.flash')) === 0) {
                 if ($this->plugins->install($package, $this->plugins)) {
                     $this->f3->push('SESSION.flash', array('type' => 'success', 'msg' => '"' . $package . '" has been installed successfully!'));
                 } else {
                     $this->f3->push('SESSION.flash', array('type' => 'danger', 'msg' => '"' . $package . '" could not be installed.'));
                 }
             }
         }
     }
 }
开发者ID:Nelrina,项目名称:mytcg-f3,代码行数:31,代码来源:PluginsController.php


示例10: __construct

 function __construct()
 {
     parent::__construct();
     $this->user = new \DB\SQL\Mapper($this->db, 'users');
     $this->audit = \Audit::instance();
     $this->bcrypt = \BCrypt::instance();
 }
开发者ID:188383,项目名称:project2,代码行数:7,代码来源:user.php


示例11: audit

 private function audit($markerSite, $action)
 {
     Log::info("Auditing " . $markerSite->id . "for " . $action);
     $data = $this->getAuditData($markerSite);
     $data["action"] = $action;
     Audit::create($data);
 }
开发者ID:skvithalani,项目名称:openmrs-contrib-atlas,代码行数:7,代码来源:AuditService.php


示例12: email

 /**
  * validate email address
  * @param string $val
  * @param string $context
  * @param bool $mx
  * @return bool
  */
 function email($val, $context = null, $mx = true)
 {
     $valid = true;
     if (!$context) {
         $context = 'error.validation.email';
     }
     if (!empty($val)) {
         if (!\Audit::instance()->email($val, false)) {
             $val = NULL;
             if (!$this->f3->exists($context . '.invalid', $errText)) {
                 $errText = 'e-mail is not valid';
             }
             $this->f3->error(400, $errText);
             $valid = false;
         } elseif ($mx && !\Audit::instance()->email($val, true)) {
             $val = NULL;
             if (!$this->f3->exists($context . '.host', $errText)) {
                 $errText = 'unknown mail mx.host';
             }
             $this->f3->error(400, $errText);
             $valid = false;
         }
     }
     if (!$valid) {
         \Flash::instance()->setKey($context, 'has-error');
     }
     return $valid;
 }
开发者ID:xfra35,项目名称:fabulog,代码行数:35,代码来源:validation.php


示例13: process

 private function process()
 {
     $this->f3->scrub($_POST);
     $audit = \Audit::instance();
     $this->f3->set('SESSION.flash', array());
     // validate form
     if (!preg_match("/^[\\w\\- ]{2,30}\$/", $this->f3->get('POST.name'))) {
         $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid name.'));
     }
     if (!$audit->email($this->f3->get('POST.email'), FALSE)) {
         $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid email address'));
     }
     if (!empty($this->f3->get('POST.url')) && !$audit->url($this->f3->get('POST.url'))) {
         $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid URL.'));
     }
     if (empty($this->f3->get('POST.message'))) {
         $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Please include a message!'));
     }
     // honey pot
     if ($this->f3->get('POST.username') !== '') {
         $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Please do not use autofill or similar tools!'));
     }
     // if there are no errors, process the form
     if (count($this->f3->get('SESSION.flash')) === 0) {
         $this->f3->set('POST.level', $this->f3->get('member')->level + 1);
         $mailer = new Mailer();
         $message = $mailer->message()->setSubject($this->f3->get('tcgname') . ': Contact Form')->setFrom(array($this->f3->get('noreplyemail') => 'MyTCG'))->setTo(array($this->f3->get('tcgemail')))->setReplyTo(array($this->f3->get('POST.email')))->setBody(Template::instance()->render('app/templates/emails/contact.htm'), 'text/html');
         if ($mailer->send($message)) {
             $this->f3->push('SESSION.flash', array('type' => 'success', 'msg' => 'Your form has been sent. Thanks for contacting us!'));
         } else {
             $this->f3->push('SESSION.flash', array('type' => 'danger', 'msg' => 'There was a problem processing your request. Please try again or contact us for assistance!'));
         }
     }
 }
开发者ID:Renako,项目名称:mytcg-f3,代码行数:34,代码来源:ContactController.php


示例14: Audit

 static function &Instance($type = null)
 {
     static $audit = NULL;
     if (!$audit) {
         $audit = new Audit();
         $result = false;
         $result = $audit->loadBy('sessionid', session_id());
         if ($result === false) {
             $data = array('sessionid' => session_id(), 'username' => '', 'customer_id' => '');
             if (isset($_SESSION['username'])) {
                 $data['username'] = $_SESSION['username'];
             }
             if (isset($_SESSION['customer_id'])) {
                 $data['customer_id'] = $_SESSION['customer_id'];
             }
             $errors = array();
             $audit = Audit::Factory($data, $errors, 'Audit');
             $audit->save();
         }
     }
     if (isset($_SESSION['username']) && $audit->username != $_SESSION['username']) {
         $audit->username = $_SESSION['username'];
         $audit->save();
     }
     return $audit;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:26,代码来源:Audit.php


示例15: _populateAudits

 protected function _populateAudits()
 {
     $audit = new Audit();
     $db = Zend_Registry::get('dbAdapter');
     $dbSelect = $db->select()->from($audit->_table)->where("startProcessing = '0000-00-00 00:00:00'")->orWhere("endProcessing = '0000-00-00 00:00:00'");
     $this->_audits = $audit->getIterator($dbSelect);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:7,代码来源:Processingd.php


示例16: _createAudit

 protected function _createAudit($providerId, $personId, $visitId, $type)
 {
     $providerId = (int) $providerId;
     $personId = (int) $personId;
     $visitId = (int) $visitId;
     $audit = array();
     $audit['objectClass'] = 'GenericAccessAudit';
     $audit['objectId'] = $personId . ';' . $visitId;
     $audit['type'] = (int) $type;
     $audit['userId'] = $providerId;
     $audit['patientId'] = $personId;
     $values = array();
     $provider = new Provider();
     $provider->personId = $audit['userId'];
     $provider->populate();
     $values['provider'] = $provider->toArray();
     $patient = new Patient();
     $patient->personId = $personId;
     $patient->populate();
     $values['patient'] = $patient->toArray();
     $values['personId'] = $patient->personId;
     $visit = new Visit();
     $visit->visitId = $visitId;
     $visit->populate();
     $values['visit'] = $visit->toArray();
     $values['visitId'] = $visit->visitId;
     $audit['auditValues'] = $values;
     Audit::persistManualAuditArray($audit);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:29,代码来源:CcdController.php


示例17: setActive

 public static function setActive()
 {
     if (!\Audit::instance()->isbot()) {
         if (class_exists('\\Activity\\Models\\Actors')) {
             $actor = \Activity\Models\Actors::fetch();
             if ($actor->isExcluded()) {
                 return;
             }
         }
         if (\Dsc\System::instance()->get('input')->get('ping', null, 'int') != 1) {
             $fw = \Base::instance();
             $path = $fw->hive()['PATH'];
             switch ($path) {
                 // ignore certain paths, even if they aren't specifically pings
                 case strpos($path, '/minify/') === 0 ? true : false:
                 case "/minify/css":
                 case "/minify/js":
                     break;
                 default:
                     (new \Dsc\Mongo\Collections\Sessions())->store();
                     break;
             }
         }
     }
     \Dsc\Mongo\Collections\Sessions::throttledCleanup();
 }
开发者ID:dioscouri,项目名称:f3-users,代码行数:26,代码来源:bootstrap.php


示例18: set_email

 /**
  * validate and set a email address for this user
  * @param $email
  * @return mixed
  */
 public function set_email($email)
 {
     if (\Audit::instance()->email($email) == false) {
         // no valid email address
         $this->throwValidationError('email');
     }
     return $email;
 }
开发者ID:Quarky9,项目名称:pathfinder,代码行数:13,代码来源:usermodel.php


示例19: audit

 /**
  * Records an audit trail
  *
  * @param array $desc the associtive array mapping the
  * db field names from the audit_log table to values
  */
 public function audit($desc)
 {
     $audit = Audit::from($desc);
     if (!$audit->validate()) {
         return false;
     }
     return $audit->create();
 }
开发者ID:jcorbinredtree,项目名称:framework,代码行数:14,代码来源:AuditComponent.php


示例20: store

 /**
  * Store a newly created resource in storage.
  * POST /employees
  *
  * @return Response
  */
 public function store()
 {
     //add new employee
     $employees = $this->employee->all();
     $save = $this->employee->create(Input::all());
     //store the logs
     Audit::store('Employees', 'Added a new employee with an id of ' . $save->id);
     return Redirect::route('employees.index')->with('employees', $employees)->with('title', 'Employees')->with('flash_message', 'Employee has been added')->with('flash_type', 'alert alert-success');
 }
开发者ID:fagray,项目名称:fposs,代码行数:15,代码来源:EmployeesController.php



注:本文中的Audit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AuditEvent类代码示例发布时间:2022-05-23
下一篇:
PHP AttributeValue类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap