本文整理汇总了PHP中Groups::removeUserOfAllGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP Groups::removeUserOfAllGroups方法的具体用法?PHP Groups::removeUserOfAllGroups怎么用?PHP Groups::removeUserOfAllGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Groups
的用法示例。
在下文中一共展示了Groups::removeUserOfAllGroups方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Delete User
*
* @param string $usrUid Unique id of User
*
* return void
*/
public function delete($usrUid)
{
try {
//Verify data
$this->throwExceptionIfNotExistsUser($usrUid, $this->arrayFieldNameForException["usrUid"]);
\G::LoadClass('case');
$oProcessMap = new \Cases();
$USR_UID = $usrUid;
$total = 0;
$history = 0;
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
$total += \ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
$total += \ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
$history += \ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
$history += \ApplicationPeer::doCount($c);
if ($total > 0) {
throw new \Exception(\G::LoadTranslation("ID_USER_CAN_NOT_BE_DELETED", array($USR_UID)));
} else {
$UID = $usrUid;
\G::LoadClass('tasks');
$oTasks = new \Tasks();
$oTasks->ofToAssignUserOfAllTasks($UID);
\G::LoadClass('groups');
$oGroups = new \Groups();
$oGroups->removeUserOfAllGroups($UID);
$this->changeUserStatus($UID, 'CLOSED');
$_GET['USR_USERNAME'] = '';
$this->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']), '');
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
$oUser = new \Users();
$aFields = $oUser->load($UID);
$aFields['USR_STATUS'] = 'CLOSED';
$aFields['USR_USERNAME'] = '';
$oUser->update($aFields);
//Delete Dashboard
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashletInstance.php");
$criteria = new \Criteria( 'workflow' );
$criteria->add( \DashletInstancePeer::DAS_INS_OWNER_UID, $UID );
$criteria->add( \DashletInstancePeer::DAS_INS_OWNER_TYPE , 'USER');
//.........这里部分代码省略.........
示例2: Tasks
$history += ApplicationPeer::doCount($c);
$response = '{success: true, candelete: ';
$response .= $total > 0 ? 'false' : 'true';
$response .= ', hashistory: ';
$response .= $history > 0 ? 'true' : 'false';
$response .= '}';
echo $response;
break;
case 'deleteUser':
$UID = $_POST['USR_UID'];
G::LoadClass('tasks');
$oTasks = new Tasks();
$oTasks->ofToAssignUserOfAllTasks($UID);
G::LoadClass('groups');
$oGroups = new Groups();
$oGroups->removeUserOfAllGroups($UID);
$RBAC->changeUserStatus($UID, 'CLOSED');
$_GET['USR_USERNAME'] = '';
$RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']), '');
require_once 'classes/model/Users.php';
$oUser = new Users();
$aFields = $oUser->load($UID);
$aFields['USR_STATUS'] = 'CLOSED';
$aFields['USR_USERNAME'] = '';
$oUser->update($aFields);
//Delete Dashboard
require_once 'classes/model/DashletInstance.php';
$criteria = new Criteria('workflow');
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_UID, $UID);
$criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, 'USER');
DashletInstancePeer::doDelete($criteria);
示例3: Users
break;
}
if ($_GET['USR_UID'] == '00000000000000000000000000000001') {
G::SendTemporalMessage('ID_CANNOT_CHANGE_STATUS_ADMIN_USER', 'error', 'usersLabels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
/*$RBAC->removeUser($_GET['USR_UID']);
require_once 'classes/model/Users.php';
$oUser = new Users();
$oUser->remove($_GET['USR_UID']);*/
//print_r($_GET['USR_UID']); die
G::LoadClass('tasks');
$oTasks = new Tasks();
$oTasks->ofToAssignUserOfAllTasks($_GET['USR_UID']);
G::LoadClass('groups');
$oGroups = new Groups();
$oGroups->removeUserOfAllGroups($_GET['USR_UID']);
$RBAC->changeUserStatus($_GET['USR_UID'], 'CLOSED');
$_GET['USR_USERNAME'] = '';
$RBAC->updateUser(array('USR_UID' => $_GET['USR_UID'], 'USR_USERNAME' => $_GET['USR_USERNAME']), '');
require_once 'classes/model/Users.php';
$oUser = new Users();
$aFields = $oUser->load($_GET['USR_UID']);
$aFields['USR_STATUS'] = 'CLOSED';
$aFields['USR_USERNAME'] = '';
$oUser->update($aFields);
G::header('location: users_List');
} catch (Exception $oException) {
die($oException->getMessage());
}