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


PHP logAuditEvent函数代码示例

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


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

示例1: addIssue

function addIssue($dbHandler, $argsObj, $itsObj)
{
    $opOK = false;
    $msg = '';
    $resultsCfg = config_get('results');
    $tcaseMgr = new testcase($dbHandler);
    $dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->tcversion_id);
    $auditSign = $tcaseMgr->getAuditSignature((object) array('id' => $dummy['parent_id']));
    $exec = current($tcaseMgr->getExecution($argsObj->exec_id, $argsObj->tcversion_id));
    $dummy = $exec['status'];
    if (isset($resultsCfg['code_status'][$exec['status']])) {
        $dummy = $resultsCfg['code_status'][$exec['status']];
    }
    $exec['statusVerbose'] = sprintf(lang_get('issue_exec_result'), $dummy);
    unset($tcaseMgr);
    $signature = sprintf(lang_get('issue_generated_description'), $argsObj->exec_id, $exec['tester_login'], $exec['testplan_name']);
    if ($exec['platform_id'] > 0) {
        $signature .= sprintf(lang_get('issue_platform'), $exec['platform_name']);
    }
    $signature .= sprintf(lang_get('issue_build') . lang_get('execution_ts_iso'), $exec['build_name'], $exec['execution_ts']) . "\n" . $exec['statusVerbose'] . "\n\n" . $exec['execution_notes'];
    $rs = $itsObj->addIssue($auditSign . ' - ' . sprintf(lang_get('execution_ts_iso'), $exec['execution_ts']), $signature);
    if ($rs['status_ok']) {
        $msg = $rs['msg'];
        $opOK = true;
        if (write_execution_bug($dbHandler, $argsObj->exec_id, $rs['id'])) {
            logAuditEvent(TLS("audit_executionbug_added", $rs['id']), "CREATE", $argsObj->exec_id, "executions");
        }
    } else {
        $msg = $rs['msg'];
    }
    return array($opOK, $msg);
}
开发者ID:mokal,项目名称:DCN_TestLink,代码行数:32,代码来源:bugAdd.php

示例2: doAuthorize

/** 
 * authorization function verifies login & password and set user session data 
 * return map
 *
 */
function doAuthorize(&$db, $login, $pwd)
{
    $result = array('status' => tl::ERROR, 'msg' => null);
    $_SESSION['locale'] = TL_DEFAULT_LOCALE;
    if (!is_null($pwd) && !is_null($login)) {
        $user = new tlUser();
        $user->login = $login;
        $login_exists = $user->readFromDB($db, tlUser::USER_O_SEARCH_BYLOGIN) >= tl::OK;
        if ($login_exists) {
            $password_check = auth_does_password_match($user, $pwd);
            if ($password_check->status_ok && $user->isActive) {
                // 20051007 MHT Solved  0000024 Session confusion
                // Disallow two sessions within one browser
                if (isset($_SESSION['currentUser']) && !is_null($_SESSION['currentUser'])) {
                    $result['msg'] = lang_get('login_msg_session_exists1') . ' <a style="color:white;" href="logout.php">' . lang_get('logout_link') . '</a>' . lang_get('login_msg_session_exists2');
                } else {
                    //Setting user's session information
                    $_SESSION['currentUser'] = $user;
                    $_SESSION['lastActivity'] = time();
                    global $g_tlLogger;
                    $g_tlLogger->endTransaction();
                    $g_tlLogger->startTransaction();
                    setUserSession($db, $user->login, $user->dbID, $user->globalRoleID, $user->emailAddress, $user->locale, null);
                    $result['status'] = tl::OK;
                }
            } else {
                logAuditEvent(TLS("audit_login_failed", $login, $_SERVER['REMOTE_ADDR']), "LOGIN_FAILED", $user->dbID, "users");
            }
        }
    }
    return $result;
}
开发者ID:tamtrong,项目名称:testlink,代码行数:37,代码来源:doAuthorize.php

示例3: doOperation

function doOperation(&$dbHandler, $argsObj, $operation)
{
    $rights = implode("','", array_keys($argsObj->grant));
    $op = new stdClass();
    $op->role = new tlRole();
    $op->role->rights = tlRight::getAll($dbHandler, "WHERE description IN ('{$rights}')");
    $op->role->name = $argsObj->rolename;
    $op->role->description = $argsObj->notes;
    $op->role->dbID = $argsObj->roleid;
    $op->userFeedback = null;
    $op->template = 'rolesEdit.tpl';
    $result = $op->role->writeToDB($dbHandler);
    if ($result >= tl::OK) {
        $auditCfg = null;
        switch ($operation) {
            case 'doCreate':
                $auditCfg['msg'] = "audit_role_created";
                $auditCfg['activity'] = "CREATE";
                break;
            case 'doUpdate':
                $auditCfg['msg'] = "audit_role_saved";
                $auditCfg['activity'] = "SAVE";
                break;
        }
        logAuditEvent(TLS($auditCfg['msg'], $argsObj->rolename), $auditCfg['activity'], $op->role->dbID, "roles");
        $op->template = null;
    } else {
        $op->userFeedback = getRoleErrorMessage($result);
    }
    return $op;
}
开发者ID:tamtrong,项目名称:testlink,代码行数:31,代码来源:rolesEdit.php

示例4: doAuthorize

/** 
 * authorization function verifies login & password and set user session data 
 * return map
 *
 */
function doAuthorize(&$db, $login, $pwd)
{
    $result = array('status' => tl::ERROR, 'msg' => null);
    $_SESSION['locale'] = TL_DEFAULT_LOCALE;
    if (!is_null($pwd) && !is_null($login)) {
        $user = new tlUser();
        $user->login = $login;
        $login_exists = $user->readFromDB($db, tlUser::USER_O_SEARCH_BYLOGIN) >= tl::OK;
        if ($login_exists) {
            $check = auth_does_password_match($user, $pwd);
            if (!$check->status_ok) {
                $result = array('status' => tl::ERROR, 'msg' => $check->msg);
            }
            if ($check->status_ok && $user->isActive) {
                // Need to do set COOKIE following Mantis model
                $auth_cookie_name = config_get('auth_cookie');
                $expireOnBrowserClose = false;
                setcookie($auth_cookie_name, $user->getSecurityCookie(), $expireOnBrowserClose, '/');
                // Disallow two sessions within one browser
                if (isset($_SESSION['currentUser']) && !is_null($_SESSION['currentUser'])) {
                    $result['msg'] = lang_get('login_msg_session_exists1') . ' <a style="color:white;" href="logout.php">' . lang_get('logout_link') . '</a>' . lang_get('login_msg_session_exists2');
                } else {
                    // Setting user's session information
                    $_SESSION['currentUser'] = $user;
                    $_SESSION['lastActivity'] = time();
                    $user->setUserSession($db);
                    global $g_tlLogger;
                    $g_tlLogger->endTransaction();
                    $g_tlLogger->startTransaction();
                    // setUserSession($db,$user->login, $user->dbID,$user->globalRoleID,$user->emailAddress, $user->locale,null);
                    $result['status'] = tl::OK;
                }
            } else {
                logAuditEvent(TLS("audit_login_failed", $login, $_SERVER['REMOTE_ADDR']), "LOGIN_FAILED", $user->dbID, "users");
            }
        }
    }
    return $result;
}
开发者ID:moraesmv,项目名称:testlink-code,代码行数:44,代码来源:doAuthorize.php

示例5: doSessionStart

 case 'doLogin':
 case 'ajaxlogin':
     doSessionStart();
     unset($_SESSION['basehref']);
     setPaths();
     $op = doAuthorize($db, $args->login, $args->pwd);
     if ($op['status'] < tl::OK) {
         $gui->note = is_null($op['msg']) ? lang_get('bad_user_passwd') : $op['msg'];
         if ($args->action == 'ajaxlogin') {
             echo json_encode(array('success' => false, 'reason' => $gui->note));
         } else {
             $doRender = true;
         }
     } else {
         $args->currentUser = $_SESSION['currentUser'];
         logAuditEvent(TLS("audit_login_succeeded", $args->login, $_SERVER['REMOTE_ADDR']), "LOGIN", $args->currentUser->dbID, "users");
         if ($args->action == 'ajaxlogin') {
             echo json_encode(array('success' => true));
         } else {
             redirect($_SESSION['basehref'] . "index.php" . ($args->preqURI ? "?reqURI=" . urlencode($args->preqURI) : ""));
         }
     }
     break;
 case 'ajaxcheck':
     doSessionStart();
     unset($_SESSION['basehref']);
     setPaths();
     $validSession = checkSessionValid($db, false);
     // Send a json reply, include localized strings for use in js to display a login form.
     echo json_encode(array('validSession' => $validSession, 'username_label' => lang_get('login_name'), 'password_label' => lang_get('password'), 'login_label' => lang_get('btn_login')));
     break;
开发者ID:tamtrong,项目名称:testlink,代码行数:31,代码来源:login.php

示例6: tlUser

    } else {
        $user = new tlUser();
        $rx = $user->checkPasswordQuality($args->password);
        if ($rx['status_ok'] >= tl::OK) {
            $result = $user->setPassword($args->password);
            if ($result >= tl::OK) {
                $user->login = $args->login;
                $user->emailAddress = $args->email;
                $user->firstName = $args->firstName;
                $user->lastName = $args->lastName;
                $result = $user->writeToDB($db);
                $cfg = config_get('notifications');
                if ($cfg->userSignUp->enabled) {
                    notifyGlobalAdmins($db, $user);
                }
                logAuditEvent(TLS("audit_users_self_signup", $args->login), "CREATE", $user->dbID, "users");
                redirect(TL_BASE_HREF . "login.php?note=first");
                exit;
            } else {
                $message = getUserErrorMessage($result);
            }
        } else {
            $message = $rx['msg'];
        }
    }
}
$smarty = new TLSmarty();
$gui = $args;
// we get info about THE DEFAULT AUTHENTICATION METHOD
$gui->external_password_mgmt = tlUser::isPasswordMgtExternal();
$gui->message = $message;
开发者ID:JacekKarwas,项目名称:smutek,代码行数:31,代码来源:firstLogin.php

示例7: doDelete

function doDelete(&$argsObj, &$cfieldMgr)
{
    $op = new stdClass();
    $op->user_feedback = '';
    $op->cf = null;
    $op->template = null;
    $op->operation_descr = '';
    $cf = $cfieldMgr->get_by_id($argsObj->cfield_id);
    if ($cf) {
        $cf = $cf[$argsObj->cfield_id];
        if ($cfieldMgr->delete($argsObj->cfield_id)) {
            logAuditEvent(TLS("audit_cfield_deleted", $cf['name']), "DELETE", $argsObj->cfield_id, "custom_fields");
        }
    }
    return $op;
}
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:16,代码来源:cfieldsEdit.php

示例8: tlUser

        $user = new tlUser(intval($userID));
        $user->readFromDB($db);
        if (tlUser::isPasswordMgtExternal($user->authentication, $user->authentication)) {
            $gui->external_password_mgmt = 1;
            $gui->password_mgmt_feedback = sprintf(lang_get('password_mgmt_feedback'), trim($args->login));
        }
    }
}
if (!$gui->external_password_mgmt && $userID) {
    echo __LINE__;
    $result = resetPassword($db, $userID);
    $gui->note = $result['msg'];
    if ($result['status'] >= tl::OK) {
        $user = new tlUser($userID);
        if ($user->readFromDB($db) >= tl::OK) {
            logAuditEvent(TLS("audit_pwd_reset_requested", $user->login), "PWD_RESET", $userID, "users");
        }
        redirect(TL_BASE_HREF . "login.php?note=lost");
        exit;
    } else {
        if ($result['status'] == tlUser::E_EMAILLENGTH) {
            $gui->note = lang_get('mail_empty_address');
        } else {
            if ($note != "") {
                $gui->note = getUserErrorMessage($result['status']);
            }
        }
    }
}
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:31,代码来源:lostPassword.php

示例9: deleteUserRoles

 /**
  * Deletes all testplan related role assignments for a given testplan
  *
  * @param int $id the testplan id
  * @return tl::OK  on success, tl::FALSE else
  **/
 function deleteUserRoles($id)
 {
     $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
     $status = tl::ERROR;
     $sql = " /* {$debugMsg} */ DELETE FROM {$this->tables['user_testplan_roles']} " . " WHERE testplan_id = {$id}";
     if ($this->db->exec_query($sql)) {
         $testPlan = $this->get_by_id($id);
         if ($testPlan) {
             logAuditEvent(TLS("audit_all_user_roles_removed_testplan", $testPlan['name']), "ASSIGN", $id, "testplans");
         }
         $status = tl::OK;
     }
     return $status;
 }
开发者ID:viglesiasce,项目名称:tl_RC1,代码行数:20,代码来源:testplan.class.php

示例10: generateAPIKey

function generateAPIKey(&$argsObj, &$user)
{
    $op = new stdClass();
    $op->status = tl::OK;
    $op->user_feedback = null;
    if ($user) {
        $APIKey = new APIKey();
        if ($APIKey->addKeyForUser($argsObj->userID) < tl::OK) {
            logAuditEvent(TLS("audit_user_apikey_set", $user->login), "CREATE", $user->login, "users");
            $op->user_feedback = lang_get('result_apikey_create_ok');
        }
    }
    return $op;
}
开发者ID:moraesmv,项目名称:testlink-code,代码行数:14,代码来源:userInfo.php

示例11: setDisplayLocation

 /**
  * set value of location attribute for one or multiple custom fields.
  *
  * 
  */
 function setDisplayLocation($tproject_id, $field_id_location)
 {
     $tproject_info = $this->tree_manager->get_node_hierarchy_info($tproject_id);
     foreach ($field_id_location as $field_id => $location) {
         $sql = "UPDATE {$this->tables['cfield_testprojects']}  " . " SET location=" . intval($location) . " WHERE testproject_id={$tproject_id} AND field_id={$field_id} ";
         $this->db->exec_query($sql);
     }
     if ($tproject_info) {
         logAuditEvent(TLS("audit_cfield_location_changed", $tproject_info['name']), "SAVE", $tproject_id, "testprojects");
     }
 }
开发者ID:moraesmv,项目名称:testlink-code,代码行数:16,代码来源:cfield_mgr.class.php

示例12: testlinkInitPage

 * @filesource  attachmentdelete.php
 * Deletes an attachment by a given id
 */
require_once '../../config.inc.php';
require_once '../functions/common.php';
require_once '../functions/attachments.inc.php';
testlinkInitPage($db, false, false, "checkRights");
$args = init_args();
$deleteDone = false;
if ($args->id) {
    $attachmentRepository = tlAttachmentRepository::create($db);
    $attachmentInfo = $attachmentRepository->getAttachmentInfo($args->id);
    if ($attachmentInfo && checkAttachmentID($db, $args->id, $attachmentInfo)) {
        $deleteDone = $attachmentRepository->deleteAttachment($args->id, $attachmentInfo);
        if ($deleteDone) {
            logAuditEvent(TLS("audit_attachment_deleted", $attachmentInfo['title']), "DELETE", $args->id, "attachments");
        }
    }
}
$smarty = new TLSmarty();
$smarty->assign('bDeleted', $deleteDone);
$smarty->display('attachmentdelete.tpl');
/**
 * @return object returns the arguments for the page
 */
function init_args()
{
    //the id (attachments.id) of the attachment to be deleted
    $iParams = array("id" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    G_PARAMS($iParams, $args);
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:31,代码来源:attachmentdelete.php

示例13: deleteInventory

 /** 
  * Deletes item from inventory on db
  *  
  * @param int $itemID
  * @return integer returns tl::OK on success, tl:ERROR else
  */
 public function deleteInventory($itemID)
 {
     $auditData = $this->getAuditData();
     $auditData = current($auditData);
     $this->inventoryId = $itemID;
     // check existence / get name of the record
     $recordset = $this->readDB($this->inventoryId);
     if (!is_null($recordset)) {
         $this->name = $recordset[0]['name'];
         $result = $this->deleteFromDB();
         if ($result == tl::OK) {
             logAuditEvent(TLS("audit_inventory_deleted", $this->name, $auditData['tproject_name']), "DELETE", $this->name, "inventory");
             $this->userFeedback = langGetFormated('inventory_delete_success', $this->name);
         } else {
             $this->userFeedback = langGetFormated('inventory_delete_fails', $this->name);
             tLog('Internal error: The device "' . $this->name . '" was not deleted.', 'ERROR');
         }
     } else {
         $this->userFeedback = lang_get('inventory_no_device') . ' ID=' . $this->inventoryId;
         tLog('Internal error: The device "' . $this->name . '" was not deleted.', 'ERROR');
     }
     return $result;
 }
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:29,代码来源:tlInventory.class.php

示例14: checkUserRightsFor

/**
 * 
 *
 */
function checkUserRightsFor(&$db, $pfn, $onFailureGoToLogin = false)
{
    $script = basename($_SERVER['PHP_SELF']);
    $currentUser = $_SESSION['currentUser'];
    $doExit = false;
    $action = null;
    $m2call = $pfn;
    $arguments = null;
    if (is_object($pfn)) {
        $m2call = $pfn->method;
        $arguments = $pfn->args;
    }
    if (!$m2call($db, $currentUser, $arguments, $action)) {
        if (!$action) {
            $action = "any";
        }
        logAuditEvent(TLS("audit_security_user_right_missing", $currentUser->login, $script, $action), $action, $currentUser->dbID, "users");
        $doExit = true;
    }
    if ($doExit) {
        $myURL = $_SESSION['basehref'];
        if ($onFailureGoToLogin) {
            unset($_SESSION['currentUser']);
            redirect($myURL . "login.php");
        } else {
            redirect($myURL, "top.location");
        }
        exit;
    }
}
开发者ID:mweyamutsvene,项目名称:testlink,代码行数:34,代码来源:common.php

示例15: testlinkInitPage

require_once 'exttable.class.php';
require_once "users.inc.php";
testlinkInitPage($db, false, false, "checkRights");
$smarty = new TLSmarty();
$templateCfg = templateConfiguration();
list($args, $gui) = initEnv($db);
switch ($args->operation) {
    case 'disable':
        // user cannot disable => inactivate itself
        if ($args->user_id != $args->currentUserID) {
            $user = new tlUser($args->user_id);
            $gui->result = $user->readFromDB($db);
            if ($gui->result >= tl::OK) {
                $gui->result = $user->setActive($db, 0);
                if ($gui->result >= tl::OK) {
                    logAuditEvent(TLS("audit_user_disabled", $user->login), "DISABLE", $args->user_id, "users");
                    $gui->user_feedback = sprintf(lang_get('user_disabled'), $user->login);
                }
            }
        }
        if ($gui->result != tl::OK) {
            $gui->user_feedback = lang_get('error_user_not_disabled');
        }
        break;
    default:
        break;
}
$gui->matrix = $users = getAllUsersForGrid($db);
$gui->images = $smarty->getImages();
$gui->tableSet[] = buildMatrix($gui, $args);
$highlight = initialize_tabsmenu();
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:31,代码来源:usersView.php


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