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


PHP CUser::delete方法代码示例

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


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

示例1: isset

$del = isset($_REQUEST['del']) ? $_REQUEST['del'] : FALSE;
$obj = new CUser();
$contact = new CContact();
if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('User');
// !User's contact information not deleted - left for history.
if ($del) {
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg("deleted", UI_MSG_ALERT, true);
        $AppUI->redirect('', -1);
    }
    return;
}
$isNewUser = !$_REQUEST['user_id'];
if ($isNewUser) {
    // check if a user with the param Username already exists
    $userEx = FALSE;
    function userExistence($userName)
    {
        global $obj, $userEx;
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:do_user_aed.php

示例2: strtolower

        $AppUI->redirect('m=public&a=access_denied');
    }
} else {
    if ($user_id != $AppUI->user_id) {
        if (!canEdit('admin')) {
            $AppUI->redirect('m=public&a=access_denied');
        }
        if (!canEdit('users')) {
            $AppUI->redirect('m=public&a=access_denied');
        }
    }
}
$obj->user_username = strtolower($obj->user_username);
// !User's contact information not deleted - left for history.
if ($del) {
    $result = $obj->delete($AppUI);
    $message = $result ? 'User deleted' : $obj->getError();
    $path = $result ? 'm=admin' : 'm=public&a=access_denied';
    $status = $result ? UI_MSG_ALERT : UI_MSG_ERROR;
    $AppUI->setMsg($message, $status);
    $AppUI->redirect($path);
}
$contact->contact_owner = $contact->contact_owner ? $contact->contact_owner : $AppUI->user_id;
$contactArray = $contact->getContactMethods();
$result = $contact->store($AppUI);
if ($result) {
    $contact->setContactMethods($contactArray);
    $obj->user_contact = $contact->contact_id;
    if ($obj->store($AppUI)) {
        if ($isNewUser && w2PgetParam($_POST, 'send_user_mail', 0)) {
            notifyNewUserCredentials($contact->contact_email, $contact->contact_first_name, $obj->user_username, $_POST['user_password']);
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:do_user_aed.php

示例3: show_messages

                         }
                     }
                     show_messages($go_result, S_USERS_UNBLOCKED, S_CANNOT_UNBLOCK_USERS);
                 } else {
                     if ($_REQUEST['go'] == 'delete' && isset($_REQUEST['group_userid'])) {
                         $go_result = false;
                         $group_userid = get_request('group_userid', array());
                         $db_users = CUser::get(array('userids' => $group_userid, 'output' => API_OUTPUT_EXTEND));
                         $db_users = zbx_toHash($db_users, 'userid');
                         DBstart();
                         foreach ($group_userid as $ugnum => $userid) {
                             if (!isset($db_users[$userid])) {
                                 continue;
                             }
                             $user_data = $db_users[$userid];
                             $go_result |= (bool) CUser::delete($user_data);
                             if (!$go_result) {
                                 error(CUser::resetErrors());
                             }
                             if ($go_result) {
                                 add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_USER, 'User alias [' . $user_data['alias'] . '] name [' . $user_data['name'] . '] surname [' . $user_data['surname'] . ']');
                             }
                         }
                         $go_result = DBend($go_result);
                         show_messages($go_result, S_USER_DELETED, S_CANNOT_DELETE_USER);
                     }
                 }
             }
         }
     }
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:users.php

示例4: elseif

} elseif ($isNewUser) {
    if (!canAdd('users')) {
        $AppUI->redirect(ACCESS_DENIED);
    }
} else {
    if ($user_id != $AppUI->user_id) {
        // @todo shouldn't this check for the specific user?
        if (!canEdit('users')) {
            $AppUI->redirect(ACCESS_DENIED);
        }
    }
}
$obj->user_username = strtolower($obj->user_username);
// !User's contact information not deleted - left for history.
if ($del) {
    $result = $obj->delete();
    $message = $result ? 'User deleted' : $obj->getError();
    $redirect = $result ? 'm=users' : ACCESS_DENIED;
    $status = $result ? UI_MSG_ALERT : UI_MSG_ERROR;
    $AppUI->setMsg($message, $status);
    $AppUI->redirect($redirect);
}
$contact->contact_owner = $contact->contact_owner ? $contact->contact_owner : $AppUI->user_id;
$contactArray = $contact->getContactMethods();
$result = $contact->store();
if ($result) {
    $contact->setContactMethods($contactArray);
    $obj->user_contact = $contact->contact_id;
    if ($obj->store()) {
        if ($isNewUser && w2PgetParam($_POST, 'send_user_mail', 0)) {
            notifyNewUserCredentials($contact->contact_email, $contact->contact_first_name, $obj->user_username, $_POST['user_password']);
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:do_user_aed.php

示例5: CUser

<?php

/**
 * This is a Branax pagecontroller.
 *
 */
// Include the essential config-file which also creates the $branax variable with its defaults.
include __DIR__ . '/config.php';
$content = new CUser($branax['database']);
// Do it and store it all in variables in the Branax container.
$branax['title'] = "Radera";
$branax['main'] = <<<EOD
<h1>Radera innehåll</h1>
{$content->delete()}
EOD;
// Finally, leave it all to the rendering phase of Branax.
include BRANAX_THEME_PATH;
开发者ID:britec,项目名称:branac-base,代码行数:17,代码来源:user_delete.php


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