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


PHP jAuth::removeUser方法代码示例

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


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

示例1: testAll

 public function testAll()
 {
     if ($this->config === null) {
         $this->sendMessage('Ldap plugin for jauth is not tested because there isn\'t configuration.' . ' To test it, you should create and configure an auth_ldap.coord.ini.php file.');
         return;
     }
     for ($i = 1; $i <= NB_USERS_LDAP; $i++) {
         $myUser = jAuth::createUserObject("testldap usr {$i}", "pass{$i}");
         $this->assertTrue($myUser instanceof jAuthUserLDAP);
         jAuth::saveNewUser($myUser);
         $myUserLDAP = jAuth::getUser("testldap usr {$i}");
         $user = "\n            <object class=\"jAuthUserLDAP\">\n                <string property=\"login\" value=\"testldap usr {$i}\" />\n                <string property=\"email\" value=\"\" />\n                <array property=\"cn\">array('testldap usr {$i}')</array>\n                <array property=\"distinguishedName\">array('CN=testldap usr {$i},{$this->config['ldap']['searchBaseDN']}')</array>\n                <array property=\"name\">array('testldap usr {$i}')</array>\n                <string property=\"password\" value=\"\" />\n            </object>\n            ";
         $this->assertComplexIdenticalStr($myUserLDAP, $user);
         $myUser->email = "usr{$i}.testldap@domain.com";
         jAuth::updateUser($myUser);
         $myUserLDAP = jAuth::getUser("testldap usr {$i}");
         $user = "\n            <object>\n                <string property=\"login\" value=\"testldap usr {$i}\" />\n                <array property=\"email\">array('usr{$i}.testldap@domain.com')</array>\n                <array property=\"cn\">array('testldap usr {$i}')</array>\n                <array property=\"distinguishedName\">array('CN=testldap usr {$i},{$this->config['ldap']['searchBaseDN']}')</array>\n                <array property=\"name\">array('testldap usr {$i}')</array>\n                <string property=\"password\" value=\"\" />\n            </object>\n            ";
         $this->assertComplexIdenticalStr($myUserLDAP, $user);
         $this->assertTrue(jAuth::verifyPassword("testldap usr {$i}", "pass{$i}"));
         $this->assertTrue(jAuth::changePassword("testldap usr {$i}", "newpass{$i}"));
     }
     $myUsersLDAP = jAuth::getUserList('testldap usr*');
     $users = "<array>";
     for ($i = 1; $i <= NB_USERS_LDAP; $i++) {
         $users .= "\n            <object>\n                <array property=\"login\">array('testldap usr {$i}')</array>\n                <array property=\"email\">array('usr{$i}.testldap@domain.com')</array>\n                <array property=\"cn\">array('testldap usr {$i}')</array>\n                <array property=\"distinguishedName\">array('CN=testldap usr {$i},{$this->config['ldap']['searchBaseDN']}')</array>\n                <array property=\"name\">array('testldap usr {$i}')</array>\n                <string property=\"password\" value=\"\" />\n            </object>\n            ";
     }
     $users .= "</array>";
     $this->assertComplexIdenticalStr($myUsersLDAP, $users);
     for ($i = 1; $i <= NB_USERS_LDAP; $i++) {
         $this->assertTrue(jAuth::removeUser("testldap usr {$i}"));
     }
     $myUsersLDAP = jAuth::getUserList('testldap usr*');
     $this->assertFalse(count($myUsersLDAP) > 0);
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:34,代码来源:jauth.ldap_api.html.php

示例2: delete

 /**
  *
  */
 function delete()
 {
     $rep = $this->getResponse('json');
     $id = $this->intParam('id', null, true);
     $this->success = false;
     if (!empty($id)) {
         try {
             $user = jDao::get('user')->get($id);
             // instanciation de la factory
             $this->success = jAuth::removeUser($user->login);
             $this->msg = "utilisateur supprimé ";
         } catch (Exception $e) {
             $this->success = false;
             $this->msg = "ERREUR : utilisateur non supprimé ";
         }
     }
     $rep->data = array('success' => $this->success, 'msg' => $this->msg);
     return $rep;
 }
开发者ID:aurellemeless,项目名称:favoris,代码行数:22,代码来源:user.classic.php

示例3: delete

 /**
  * delete a record
  */
 function delete()
 {
     $id = $this->param('id');
     $pwd = $this->param('pwd_confirm');
     $rep = $this->getResponse('redirect');
     if (jAuth::verifyPassword(jAuth::getUserSession()->login, $pwd) == false) {
         jMessage::add(jLocale::get('crud.message.delete.invalid.pwd'), 'error');
         $rep->action = 'default:confirmdelete';
         $rep->params['id'] = $id;
         return $rep;
     }
     if ($id !== null && jAuth::getUserSession()->login != $id) {
         if (jAuth::removeUser($id)) {
             jMessage::add(jLocale::get('crud.message.delete.ok', $id), 'notice');
             $rep->action = 'default:index';
         } else {
             jMessage::add(jLocale::get('crud.message.delete.notok'), 'error');
             $rep->action = 'default:view';
             $rep->params['id'] = $id;
         }
     } else {
         jMessage::add(jLocale::get('crud.message.delete.notok'), 'error');
         $rep->action = 'default:index';
     }
     return $rep;
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:29,代码来源:default.classic.php

示例4: dodestroy

 function dodestroy()
 {
     $user = $this->param('user');
     $rep = $this->getResponse('redirect');
     $rep->action = 'jcommunity~account:show';
     $rep->params = array('user' => $user);
     if ($user == '' || !jAuth::isConnected() || jAuth::getUserSession()->login != $user) {
         return $rep;
     }
     $rep = $this->getResponse('html');
     $tpl = new jTpl();
     $tpl->assign('username', $user);
     if (jAuth::removeUser($user)) {
         jAuth::logout();
         $rep->body->assign('MAIN', $tpl->fetch('account_destroy_done'));
     } else {
         $rep->body->assign('MAIN', $tpl->fetch('account_destroy_cancel'));
     }
     return $rep;
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:20,代码来源:account.classic.php


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