当前位置: 首页>>代码示例>>PHP>>正文


PHP TTLog类代码示例

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


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

示例1: addLog

 function addLog($log_action)
 {
     return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Recurring Pay Stub Amendment'), NULL, $this->getTable(), $this);
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:4,代码来源:RecurringPayStubAmendmentFactory.class.php

示例2: changePassword

 /**
  * Allows currently logged in user to change their password.
  * @param string $current_password
  * @param string $new_password
  * @param string $new_password2
  * @param string $type
  * @return bool
  */
 function changePassword($current_password, $new_password, $new_password2, $type = 'web')
 {
     $ulf = TTnew('UserListFactory');
     $ulf->getByIdAndCompanyId($this->getCurrentUserObject()->getId(), $this->getCurrentCompanyObject()->getId());
     if ($ulf->getRecordCount() == 1) {
         $uf = $ulf->getCurrent();
         switch (strtolower($type)) {
             case 'quick_punch':
             case 'phone':
                 if ($this->getPermissionObject()->Check('user', 'edit_own_phone_password') == FALSE) {
                     return $this->getPermissionObject()->PermissionDenied();
                 }
                 $log_description = TTi18n::getText('Password - Phone');
                 if ($current_password != '') {
                     if ($uf->checkPhonePassword($current_password) !== TRUE) {
                         Debug::Text('Password check failed!', __FILE__, __LINE__, __METHOD__, 10);
                         $uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
                     }
                 } else {
                     Debug::Text('Current password not specified', __FILE__, __LINE__, __METHOD__, 10);
                     $uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
                 }
                 if ($new_password != '' or $new_password2 != '') {
                     if ($new_password == $new_password2) {
                         $uf->setPhonePassword($new_password);
                     } else {
                         $uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
                     }
                 } else {
                     $uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
                 }
                 break;
             case 'web':
                 if ($this->getPermissionObject()->Check('user', 'edit_own_password') == FALSE) {
                     return $this->getPermissionObject()->PermissionDenied();
                 }
                 $log_description = TTi18n::getText('Password - Web');
                 if ($current_password != '') {
                     if ($uf->checkPassword($current_password) !== TRUE) {
                         Debug::Text('Password check failed!', __FILE__, __LINE__, __METHOD__, 10);
                         $uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
                     }
                 } else {
                     Debug::Text('Current password not specified', __FILE__, __LINE__, __METHOD__, 10);
                     $uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
                 }
                 if ($new_password != '' or $new_password2 != '') {
                     if ($new_password == $new_password2) {
                         $uf->setPassword($new_password);
                     } else {
                         $uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
                     }
                 } else {
                     $uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
                 }
                 break;
         }
         if ($uf->isValid()) {
             if (DEMO_MODE == TRUE) {
                 //Return TRUE even in demo mode, but nothing happens.
                 return $this->returnHandler(TRUE);
             } else {
                 TTLog::addEntry($this->getCurrentUserObject()->getId(), 20, $log_description, NULL, $uf->getTable());
                 return $this->returnHandler($uf->Save());
                 //Single valid record
             }
         } else {
             return $this->returnHandler(FALSE, 'VALIDATION', TTi18n::getText('INVALID DATA'), $uf->Validator->getErrorsArray(), array('total_records' => 1, 'valid_records' => 0));
         }
     }
     return $this->returnHandler(FALSE);
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:80,代码来源:APIUser.class.php

示例3: TTUser

$tsess = TTGenid::getbypid($touser);
$ftu = new TTUser($fsess['id']);
$ttu = new TTUser($tsess['id']);
$att = $tsess['authat'];
$ut = $tsess['ut'];
$gemd = $tsess['gemd'];
if ($link['gift']) {
    $lg = $link['gift'];
} else {
    $lg = 0;
}
$new = 0;
if ($_REQUEST['new']) {
    $new = 1;
}
TTLog::record(array('m' => 'accept_invite', 'tm' => $_SERVER['REQUEST_TIME'], 'u' => $fromuser, 'sp1' => $lg, 'sp2' => $new, 'intp1' => $touser));
//$tudata=$ftu->getf(array('name','icon'));
$getted = $link['geted'];
$ids = $link['ids'];
$got = false;
$invite = false;
if (strtotime($link['date']) < strtotime('20100906')) {
    foreach ($ids as $id) {
        if ($id == $touser) {
            $invite = true;
            break;
        }
    }
    foreach ($getted as $u => $v) {
        if ($u == $touser) {
            $got = true;
开发者ID:uning,项目名称:mall-back,代码行数:31,代码来源:accept.php

示例4: addLog

 function addLog($log_action)
 {
     $u_obj = $this->getUserObject();
     if (is_object($u_obj)) {
         return TTLog::addEntry($this->getStation(), $log_action, TTi18n::getText('Employee') . ': ' . $u_obj->getFullName(FALSE, TRUE), NULL, $this->getTable());
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:8,代码来源:StationIncludeUserFactory.class.php

示例5: addLog

 function addLog($log_action)
 {
     return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Company Deduction'), NULL, $this->getTable());
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:4,代码来源:CompanyDeductionFactory.class.php

示例6:

<?php

require_once 'ttserver/test_config.php';
//璁板綍鏃ュ織
$m = $_GET['m'];
if ($m) {
    $_GET['tm'] = $_SERVER['REQUEST_TIME'];
    TTLog::record($_GET);
}
开发者ID:uning,项目名称:mall-back,代码行数:9,代码来源:error.php

示例7: runManualCommand


//.........这里部分代码省略.........
             }
             $s_obj->setLastPunchTimeStamp($s_obj->getLastPunchTimeStamp());
             if ($s_obj->getTimeZone() != '' and !is_numeric($s_obj->getTimeZone())) {
                 Debug::text('Setting Station TimeZone To: ' . $s_obj->getTimeZone(), __FILE__, __LINE__, __METHOD__, 10);
                 TTDate::setTimeZone($s_obj->getTimeZone());
             }
             $result_str = NULL;
             switch ($command) {
                 case 'test_connection':
                     if ($tc->testConnection() == TRUE) {
                         $result_str = TTi18n::gettext('Connection Succeeded!');
                     } else {
                         $result_str = TTi18n::gettext('Connection Failed!');
                     }
                     break;
                 case 'set_date':
                     TTDate::setTimeZone($row['time_zone_id'], $s_obj->getTimeZone());
                     if ($tc->setDate(time()) == TRUE) {
                         $result_str = TTi18n::gettext('Date Successfully Set To: ') . TTDate::getDate('DATE+TIME', time());
                     } else {
                         $result_str = TTi18n::gettext('Setting Date Failed!');
                     }
                     break;
                 case 'download':
                     if (isset($s_obj) and $tc->Poll($this->getCurrentCompanyObject(), $s_obj) == TRUE) {
                         $result_str = TTi18n::gettext('Download Data Succeeded!');
                         if ($s_obj->isValid()) {
                             $s_obj->Save(FALSE);
                         }
                     } else {
                         $result_str = TTi18n::gettext('Download Data Failed!');
                     }
                     break;
                 case 'upload':
                     if (isset($s_obj) and $tc->Push($this->getCurrentCompanyObject(), $s_obj) == TRUE) {
                         $result_str = TTi18n::gettext('Upload Data Succeeded!');
                         if ($s_obj->isValid()) {
                             $s_obj->Save(FALSE);
                         }
                     } else {
                         $result_str = TTi18n::gettext('Upload Data Failed!');
                     }
                     break;
                 case 'update_config':
                     if (isset($s_obj) and $tc->setModeFlag($s_obj->getModeFlag()) == TRUE) {
                         $result_str = TTi18n::gettext('Update Configuration Succeeded');
                     } else {
                         $result_str = TTi18n::gettext('Update Configuration Failed');
                     }
                     break;
                 case 'delete_data':
                     if (isset($s_obj) and $tc->DeleteAllData($s_obj) == TRUE) {
                         $result_str = TTi18n::gettext('Delete Data Succeeded!');
                         if ($s_obj->isValid()) {
                             $s_obj->Save(FALSE);
                         }
                     } else {
                         $result_str = TTi18n::gettext('Delete Data Failed!');
                     }
                     break;
                 case 'reset_last_punch_time_stamp':
                     $s_obj->setLastPunchTimeStamp(time());
                     if ($s_obj->isValid()) {
                         $s_obj->Save(FALSE);
                     }
                     $result_str = TTi18n::gettext('Reset Last Punch Time Succeeded!');
                     break;
                 case 'clear_last_punch_time_stamp':
                     $s_obj->setLastPunchTimeStamp(1);
                     if ($s_obj->isValid()) {
                         $s_obj->Save(FALSE);
                     }
                     $result_str = TTi18n::gettext('Clear Last Punch Time Succeeded!');
                     break;
                 case 'restart':
                     $tc->restart();
                     $result_str = TTi18n::gettext('Restart Succeeded!');
                     break;
                 case 'firmware':
                     if ($tc->setFirmware() == TRUE) {
                         $result_str = TTi18n::gettext('Firmware Update Succeeded!');
                     } else {
                         $result_str = TTi18n::gettext('Firmware Update Failed!');
                     }
                     break;
                 default:
                     $result_str = TTi18n::gettext('Invalid manual command!');
                     break;
             }
             TTLog::addEntry($s_obj->getId(), 500, TTi18n::getText('TimeClock Manual Command') . ': ' . ucwords(str_replace('_', ' ', $command)) . ' ' . TTi18n::getText('Result') . ': ' . $result_str, NULL, $s_obj->getTable());
             if (isset($s_obj)) {
                 $row['last_poll_date'] = $s_obj->getLastPollDate();
                 $row['last_push_date'] = $s_obj->getLastPushDate();
             }
             unset($s_obj, $slf);
         }
         return $this->returnHandler($result_str);
     }
     return $this->returnHandler(FALSE);
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:APIStation.class.php

示例8: addLog

 function addLog($log_action)
 {
     return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Punch - Employee') . ': ' . $this->getUser() . TTi18n::getText(' Timestamp') . ': ' . TTDate::getDate('DATE+TIME', $this->getTimeStamp()), NULL, $this->getTable());
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:4,代码来源:PunchFactory.class.php

示例9: update_help

 /**
 * 更新帮助获取物品
 * @param
              tag 
              fid
 
 * @return  one or a array of help open objects
 */
 public function update_help($tag, $fid)
 {
     $oid = $this->getoid($tag, 'ho');
     $obj = $this->getbyid($oid);
     $now = $_SERVER['REQUEST_TIME'];
     $obj['help'][$fid] = $now;
     $obj['id'] = $oid;
     TTLog::record(array('s' => 'OK', 'm' => __METHOD__, 'tm' => $now, 'sp1' => $tag, 'intp1' => $fid));
     $this->puto($obj);
 }
开发者ID:uning,项目名称:mall-back,代码行数:18,代码来源:TTUser.php

示例10: emailMessage

 function emailMessage()
 {
     Debug::Text('emailMessage: ', __FILE__, __LINE__, __METHOD__, 10);
     $email_to_arr = $this->getEmailMessageAddresses();
     if ($email_to_arr == FALSE) {
         return FALSE;
     }
     $from = $reply_to = 'DoNotReply@' . Misc::getHostName(FALSE);
     global $current_user, $config_vars;
     if (is_object($current_user) and $current_user->getWorkEmail() != '') {
         $reply_to = $current_user->getWorkEmail();
     }
     Debug::Text('From: ' . $from . ' Reply-To: ' . $reply_to, __FILE__, __LINE__, __METHOD__, 10);
     $to = array_shift($email_to_arr);
     Debug::Text('To: ' . $to, __FILE__, __LINE__, __METHOD__, 10);
     if (is_array($email_to_arr) and count($email_to_arr) > 0) {
         $bcc = implode(',', $email_to_arr);
     } else {
         $bcc = NULL;
     }
     $email_subject = TTi18n::gettext('New message waiting in') . ' ' . APPLICATION_NAME;
     $email_body = TTi18n::gettext('*DO NOT REPLY TO THIS EMAIL - PLEASE USE THE LINK BELOW INSTEAD*') . "\n\n";
     $email_body .= TTi18n::gettext('You have a new message waiting for you in') . ' ' . APPLICATION_NAME . "\n";
     if ($this->getSubject() != '') {
         $email_body .= TTi18n::gettext('Subject:') . ' ' . $this->getSubject() . "\n";
     }
     $protocol = 'http';
     if (isset($config_vars['other']['force_ssl']) and $config_vars['other']['force_ssl'] == 1) {
         $protocol .= 's';
     }
     $email_body .= TTi18n::gettext('Link') . ': <a href="' . $protocol . '://' . Misc::getHostName() . Environment::getDefaultInterfaceBaseURL() . '">' . APPLICATION_NAME . ' ' . TTi18n::getText('Login') . '</a>';
     //Define subject/body variables here.
     $search_arr = array('#employee_first_name#', '#employee_last_name#');
     $replace_arr = array(NULL, NULL);
     $subject = str_replace($search_arr, $replace_arr, $email_subject);
     Debug::Text('Subject: ' . $subject, __FILE__, __LINE__, __METHOD__, 10);
     $headers = array('From' => $from, 'Subject' => $subject, 'Bcc' => $bcc, 'Reply-To' => $reply_to, 'Return-Path' => $reply_to, 'Errors-To' => $reply_to);
     $body = '<pre>' . str_replace($search_arr, $replace_arr, $email_body) . '</pre>';
     Debug::Text('Body: ' . $body, __FILE__, __LINE__, __METHOD__, 10);
     $mail = new TTMail();
     $mail->setTo($to);
     $mail->setHeaders($headers);
     @$mail->getMIMEObject()->setHTMLBody($body);
     $mail->setBody($mail->getMIMEObject()->get($mail->default_mime_config));
     $retval = $mail->Send();
     if ($retval == TRUE) {
         TTLog::addEntry($this->getId(), 500, TTi18n::getText('Email Message to') . ': ' . $to . ' Bcc: ' . $headers['Bcc'], NULL, $this->getTable());
         return TRUE;
     }
     return TRUE;
     //Always return true
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:52,代码来源:MessageFactory.class.php

示例11: addLog

 function addLog($log_action)
 {
     return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Pay Stub Amendment - User ID') . ': ' . $this->getUser() . ' ' . TTi18n::getText('Amount') . ': ' . $this->getAmount(), NULL, $this->getTable());
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:4,代码来源:PayStubAmendmentFactory.class.php

示例12: addLog

 function addLog($log_action)
 {
     //Don't do detail logging for this, as it will store entire figerprints in the log table.
     return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Employee Identification - Employee') . ': ' . UserListFactory::getFullNameById($this->getUser()) . ' ' . TTi18n::getText('Type') . ': ' . Option::getByKey($this->getType(), $this->getOptions('type')), NULL, $this->getTable());
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:5,代码来源:UserIdentificationFactory.class.php

示例13: addLog

 function addLog($log_action)
 {
     return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Ethnic Group: ') . $this->getName(), NULL, $this->getTable(), $this);
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:4,代码来源:EthnicGroupFactory.class.php

示例14: addLog

 function addLog($log_action)
 {
     $obj = $this->getUserObject();
     if (is_object($obj)) {
         return TTLog::addEntry($this->getCompanyDeduction(), $log_action, TTi18n::getText('Employee Deduction') . ': ' . $obj->getFullName(), NULL, $this->getTable(), $this);
     }
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:7,代码来源:UserDeductionFactory.class.php

示例15: addLog

 function addLog($log_action)
 {
     $u_obj = $this->getUserObject();
     if (is_object($u_obj)) {
         return TTLog::addEntry($this->getHierarchyControl(), $log_action, TTi18n::getText('Superior') . ': ' . $u_obj->getFullName() . ' ' . TTi18n::getText('Level') . ': ' . $this->getLevel(), NULL, $this->getTable(), $this);
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:8,代码来源:HierarchyLevelFactory.class.php


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