當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Profile_User::deleteRights方法代碼示例

本文整理匯總了PHP中Profile_User::deleteRights方法的典型用法代碼示例。如果您正苦於以下問題:PHP Profile_User::deleteRights方法的具體用法?PHP Profile_User::deleteRights怎麽用?PHP Profile_User::deleteRights使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Profile_User的用法示例。


在下文中一共展示了Profile_User::deleteRights方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: manageDeletedUserInLdap

 /**
  * @param $users_id
  **/
 static function manageDeletedUserInLdap($users_id)
 {
     global $CFG_GLPI;
     //User is present in DB but not in the directory : it's been deleted in LDAP
     $tmp['id'] = $users_id;
     $myuser = new User();
     switch ($CFG_GLPI['user_deleted_ldap']) {
         //DO nothing
         default:
         case 0:
             break;
             //Put user in dustbin
         //Put user in dustbin
         case 1:
             $myuser->delete($tmp);
             break;
             //Delete all user dynamic habilitations and groups
         //Delete all user dynamic habilitations and groups
         case 2:
             Profile_User::deleteRights($users_id, true);
             Group_User::deleteGroups($users_id, true);
             break;
             //Deactivate the user
         //Deactivate the user
         case 3:
             $tmp['is_active'] = 0;
             $myuser->update($tmp);
             break;
     }
     $changes[0] = '0';
     $changes[1] = '';
     $changes[2] = __('Deleted user in LDAP directory');
     Log::history($users_id, 'User', $changes, 0, Log::HISTORY_LOG_SIMPLE_MESSAGE);
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:37,代碼來源:user.class.php

示例2: manageDeletedUserInLdap

 /**
  * @param $users_id
  **/
 static function manageDeletedUserInLdap($users_id)
 {
     global $CFG_GLPI;
     //The only case where users_id can be null if when a user has been imported into GLPi
     //it's dn still exists, but doesn't match the connection filter anymore
     //In this case, do not try to process the user
     if (!$users_id) {
         return true;
     }
     //User is present in DB but not in the directory : it's been deleted in LDAP
     $tmp['id'] = $users_id;
     $tmp['is_deleted_ldap'] = 1;
     $myuser = new self();
     $myuser->getFromDB($users_id);
     //User is already considered as delete from ldap
     if ($myuser->fields['is_deleted_ldap'] == 1) {
         return;
     }
     switch ($CFG_GLPI['user_deleted_ldap']) {
         //DO nothing
         default:
         case 0:
             $myuser->update($tmp);
             break;
             //Put user in dustbin
         //Put user in dustbin
         case 1:
             $myuser->delete($tmp);
             break;
             //Delete all user dynamic habilitations and groups
         //Delete all user dynamic habilitations and groups
         case 2:
             Profile_User::deleteRights($users_id, true);
             Group_User::deleteGroups($users_id, true);
             $myuser->update($tmp);
             break;
             //Deactivate the user
         //Deactivate the user
         case 3:
             $tmp['is_active'] = 0;
             $myuser->update($tmp);
             break;
             //Deactivate the user+ Delete all user dynamic habilitations and groups
         //Deactivate the user+ Delete all user dynamic habilitations and groups
         case 4:
             $tmp['is_active'] = 0;
             $myuser->update($tmp);
             Profile_User::deleteRights($users_id, true);
             Group_User::deleteGroups($users_id, true);
             break;
     }
     /*
           $changes[0] = '0';
           $changes[1] = '';
           $changes[2] = __('Deleted user in LDAP directory');
           Log::history($users_id, 'User', $changes, 0, Log::HISTORY_LOG_SIMPLE_MESSAGE);*/
 }
開發者ID:stweil,項目名稱:glpi,代碼行數:60,代碼來源:user.class.php


注:本文中的Profile_User::deleteRights方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。