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


PHP ilObjUser::_getUserIdsByEmail方法代码示例

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


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

示例1: submitUsernameAssistanceForm

 /** Reads the submitted data from the password assistance form.
  * 
  * The following form fields are read as HTTP POST parameters:
  * username
  * email
  *
  * If the submitted username and email address matches an entry in the user data 
  * table, then ILIAS creates a password assistance session for the user, and
  * sends a password assistance mail to the email address.
  * For details about the creation of the session and the e-mail see function
  * sendPasswordAssistanceMail().
  */
 function submitUsernameAssistanceForm()
 {
     global $tpl, $ilias, $lng, $rbacadmin, $rbacreview;
     require_once './Services/User/classes/class.ilObjUser.php';
     require_once "./Services/Utilities/classes/class.ilUtil.php";
     // Retrieve form data
     $email = ilUtil::stripSlashes($_POST["email"]);
     // Retrieve a user object with matching user name and email address.
     $logins = ilObjUser::_getUserIdsByEmail($email);
     // No matching user object found?
     // Show the password assistance form again, and display an error message.
     if (count($logins) < 1) {
         $this->showUsernameAssistanceForm($lng->txt("pwassist_invalid_email"), "", $email);
     } elseif (!strlen($email)) {
         $this->showUsernameAssistanceForm($lng->txt("pwassist_invalid_email"), "", $email);
     } else {
         $this->sendUsernameAssistanceMail($email, $logins);
         $this->showMessageForm(null, sprintf($lng->txt("pwassist_mail_sent"), $email));
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:32,代码来源:class.ilPasswordAssistanceGUI.php

示例2: testAuthAndEmailMethods

 /**
  * Auth and email related methods
  * @group IL_Init
  */
 public function testAuthAndEmailMethods()
 {
     include_once "./Services/User/classes/class.ilObjUser.php";
     $value = "";
     // creation
     $user = new ilObjUser();
     $d = array("login" => "aatestuser2", "passwd_type" => IL_PASSWD_PLAIN, "passwd" => "password", "gender" => "f", "firstname" => "Heidi", "lastname" => "Kabel", "email" => "qwe@ty.de", "ext_account" => "ext_");
     $user->assignData($d);
     $user->setActive(true);
     $user->create();
     $user->saveAsNew();
     $user->setLanguage("de");
     $user->writePrefs();
     $id = $user->getId();
     ilObjUser::_writeExternalAccount($id, "ext_kabel");
     ilObjUser::_writeAuthMode($id, "cas");
     $ids = ilObjUser::_getUserIdsByEmail("qwe@ty.de");
     //var_dump($ids);
     if (is_array($ids) && count($ids) == 1 && $ids[0] == "aatestuser2") {
         $value .= "email1-";
     }
     $uid = ilObjUser::getUserIdByEmail("qwe@ty.de");
     if ($uid == $id) {
         $value .= "email2-";
     }
     $acc = ilObjUser::_getExternalAccountsByAuthMode("cas");
     foreach ($acc as $k => $v) {
         if ($k == $id && $v == "ext_kabel") {
             $value .= "auth1-";
         }
     }
     if (ilObjUser::_lookupAuthMode($id) == "cas") {
         $value .= "auth2-";
     }
     if (ilObjUser::_checkExternalAuthAccount("cas", "ext_kabel") == "aatestuser2") {
         $value .= "auth3-";
     }
     if (ilObjUser::_externalAccountExists("ext_kabel", "cas")) {
         $value .= "auth4-";
     }
     ilObjUser::_getNumberOfUsersPerAuthMode();
     $la = ilObjUser::_getLocalAccountsForEmail("qwe@ty.de");
     ilObjUser::_incrementLoginAttempts($id);
     ilObjUser::_getLoginAttempts($id);
     ilObjUser::_resetLoginAttempts($id);
     ilObjUser::_setUserInactive($id);
     // deletion
     $user->delete();
     $this->assertEquals("email1-email2-auth1-auth2-auth3-auth4-", $value);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:54,代码来源:ilObjUserTest.php

示例3: submitUsernameAssistanceForm

 /**
  * Reads the submitted data from the password assistance form.
  * The following form fields are read as HTTP POST parameters:
  * username
  * email
  * If the submitted username and email address matches an entry in the user data
  * table, then ILIAS creates a password assistance session for the user, and
  * sends a password assistance mail to the email address.
  * For details about the creation of the session and the e-mail see function
  * sendPasswordAssistanceMail().
  */
 public function submitUsernameAssistanceForm()
 {
     require_once 'Services/User/classes/class.ilObjUser.php';
     require_once 'Services/Utilities/classes/class.ilUtil.php';
     $form = $this->getUsernameAssistanceForm();
     if (!$form->checkInput()) {
         $form->setValuesByPost();
         $this->showUsernameAssistanceForm($form);
         return;
     }
     // Retrieve form data
     $email = $form->getInput('email');
     // Retrieve a user object with matching user name and email address.
     $logins = ilObjUser::_getUserIdsByEmail($email);
     // No matching user object found?
     // Show the password assistance form again, and display an error message.
     if (!is_array($logins) || count($logins) < 1) {
         ilUtil::sendFailure(str_replace("\\n", '', $this->lng->txt('pwassist_invalid_email')));
         $form->setValuesByPost();
         $this->showUsernameAssistanceForm($form);
     } else {
         $this->sendUsernameAssistanceMail($email, $logins);
         $this->showMessageForm(sprintf($this->lng->txt('pwassist_mail_sent'), $email));
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:36,代码来源:class.ilPasswordAssistanceGUI.php


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