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


PHP ilUtil::is_email方法代码示例

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


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

示例1: handleCurrentRecipient

 /**
  * @param string $rcp
  * @throws ilMailException
  */
 protected function handleCurrentRecipient($rcp)
 {
     require_once 'Services/Mail/exceptions/class.ilMailException.php';
     if (is_numeric($rcp)) {
         /**
          * @var $rcp ilObjUser
          */
         $rcp = ilObjectFactory::getInstanceByObjId($rcp, false);
         if (!$rcp) {
             throw new ilMailException('no_recipient_found');
         }
         $this->setCurrentRecipient($rcp->getEmail());
         $this->initLanguage($rcp->getId());
     } else {
         if (is_string($rcp) && ilUtil::is_email($rcp)) {
             $this->setCurrentRecipient($rcp);
             $this->initLanguageByIso2Code();
         } else {
             if ($rcp instanceof ilObjUser) {
                 /**
                  * @var $rcp ilObjUser
                  */
                 $this->setCurrentRecipient($rcp->getEmail());
                 $this->initLanguage($rcp->getId());
             } else {
                 throw new ilMailException('no_recipient_found');
             }
         }
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:34,代码来源:class.ilMimeMailNotification.php

示例2: checkInput

 /**
  * Check input, strip slashes etc. set alert, if input is not ok.
  *
  * @return	boolean		Input ok, true/false
  */
 function checkInput()
 {
     global $lng;
     $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
     if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
         $this->setAlert($lng->txt("msg_input_is_required"));
         return false;
     }
     if (!ilUtil::is_email($_POST[$this->getPostVar()]) && trim($_POST[$this->getPostVar()]) != "") {
         $this->setAlert($lng->txt("email_not_valid"));
         return false;
     }
     return true;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:19,代码来源:class.ilEMailInputGUI.php

示例3: validate

 public function validate()
 {
     global $ilErr, $lng;
     if (!count($this->getRecipients())) {
         return true;
     }
     foreach ((array) $this->getRecipients() as $rcp_data) {
         if ($rcp_data['type'] == self::TYPE_USER) {
             continue;
         } else {
             if (!ilUtil::is_email($rcp_data['email'])) {
                 $ilErr->appendMessage($lng->txt('cal_err_invalid_notification_rcps'));
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:18,代码来源:class.ilCalendarUserNotification.php

示例4: validateInfoSettings

 function validateInfoSettings()
 {
     global $ilErr;
     $error = false;
     if ($this->getContactEmail()) {
         $emails = split(",", $this->getContactEmail());
         foreach ($emails as $email) {
             $email = trim($email);
             if (!(ilUtil::is_email($email) or ilObjUser::getUserIdByLogin($email))) {
                 $ilErr->appendMessage($this->lng->txt('contact_email_not_valid') . " '" . $email . "'");
                 $error = true;
             }
         }
     }
     return !$error;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:16,代码来源:class.ilObjCourse.php

示例5: getEmailOfSender

 /**
  * get email of sender
  * @access	public
  * @return	string email
  */
 function getEmailOfSender()
 {
     $umail = self::getCachedUserInstance($this->user_id);
     $sender = $umail->getEmail();
     if (ilUtil::is_email($sender)) {
         return $sender;
     } else {
         return '';
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:15,代码来源:class.ilMail.php

示例6: mailUserResultsObject

 function mailUserResultsObject()
 {
     global $ilUser;
     $anonymous_code = $_SESSION["anonymous_id"][$this->object->getId()];
     $active_id = $this->object->getActiveID($ilUser->getId(), $anonymous_code, 0);
     if ($this->object->isSurveyStarted($ilUser->getId(), $anonymous_code) !== 1 || !$active_id) {
         $this->ctrl->redirect($this, "infoScreen");
     }
     $recipient = $_POST["mail"];
     if (!ilUtil::is_email($recipient)) {
         $this->ctrl->redirect($this, "infoScreen");
     }
     $this->sendUserResultsMail($active_id, $recipient);
     ilUtil::sendSuccess($this->lng->txt("mail_sent"), true);
     $this->ctrl->redirect($this, "infoScreen");
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:16,代码来源:class.ilObjSurveyGUI.php

示例7: updateCode

 public function updateCode($a_id, $a_email, $a_last_name, $a_first_name, $a_sent)
 {
     global $ilDB;
     $a_email = trim($a_email);
     // :TODO:
     if ($a_email && !ilUtil::is_email($a_email)) {
         return;
     }
     $data = array("email" => $a_email, "lastname" => trim($a_last_name), "firstname" => trim($a_first_name));
     $fields = array("externaldata" => array("text", serialize($data)), "sent" => array("integer", $a_sent));
     $ilDB->update("svy_anonymous", $fields, array("anonymous_id" => array("integer", $a_id)));
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:12,代码来源:class.ilObjSurvey.php

示例8: checkClientContact

 /**
  * check client contact data status
  * @param	object	client
  * @return	boolean
  */
 function checkClientContact(&$client)
 {
     $arr["status"] = true;
     //$arr["comment"] = $this->lng->txt("filled_out");
     $settings = $client->getAllSettings();
     $client_name = $client->getName();
     // check required fields
     if (empty($settings["admin_firstname"]) or empty($settings["admin_lastname"]) or empty($settings["admin_email"]) or empty($client_name)) {
         $arr["status"] = false;
         $arr["comment"] = $this->lng->txt("missing_data");
     }
     // admin email
     if (!ilUtil::is_email($settings["admin_email"]) and $arr["status"] != false) {
         $arr["status"] = false;
         $arr["comment"] = $this->lng->txt("email_not_valid");
     }
     return $arr;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:23,代码来源:class.ilSetup.php

示例9: saveProfile

 /**
  * save user profile data
  */
 function saveProfile()
 {
     global $ilUser, $ilSetting, $ilAuth;
     //init checking var
     $form_valid = true;
     // testing by ratana ty:
     // if people check on check box it will
     // write some datata to table usr_pref
     // if check on Public Profile
     if ($_POST["chk_pub"] == "on") {
         $ilUser->setPref("public_profile", "y");
     } else {
         $ilUser->setPref("public_profile", "n");
     }
     // if check on Institute
     $val_array = array("institution", "department", "upload", "street", "zip", "city", "country", "phone_office", "phone_home", "phone_mobile", "fax", "email", "hobby", "matriculation");
     // set public profile preferences
     foreach ($val_array as $key => $value) {
         if ($_POST["chk_" . $value] == "on") {
             $ilUser->setPref("public_" . $value, "y");
         } else {
             $ilUser->setPref("public_" . $value, "n");
         }
     }
     $d_set = new ilSetting("delicious");
     if ($d_set->get("user_profile")) {
         if ($_POST["chk_delicious"] == "on") {
             $ilUser->setPref("public_delicious", "y");
         } else {
             $ilUser->setPref("public_delicious", "n");
         }
     }
     // check dynamically required fields
     foreach ($this->settings as $key => $val) {
         if (substr($key, 0, 8) == "require_") {
             $require_keys[] = substr($key, 8);
         }
     }
     foreach ($require_keys as $key => $val) {
         // exclude required system and registration-only fields
         $system_fields = array("login", "default_role", "passwd", "passwd2");
         if (!in_array($val, $system_fields)) {
             if ($this->workWithUserSetting($val)) {
                 if (isset($this->settings["require_" . $val]) && $this->settings["require_" . $val]) {
                     if (empty($_POST["usr_" . $val])) {
                         ilUtil::sendFailure($this->lng->txt("fill_out_all_required_fields") . ": " . $this->lng->txt($val));
                         $form_valid = false;
                     }
                 }
             }
         }
     }
     // Check user defined required fields
     if ($form_valid and !$this->__checkUserDefinedRequiredFields()) {
         ilUtil::sendFailure($this->lng->txt("fill_out_all_required_fields"));
         $form_valid = false;
     }
     // check email
     if ($this->workWithUserSetting("email")) {
         if (!ilUtil::is_email($_POST["usr_email"]) and !empty($_POST["usr_email"]) and $form_valid) {
             ilUtil::sendFailure($this->lng->txt("email_not_valid"));
             $form_valid = false;
         }
     }
     //update user data (not saving!)
     if ($this->workWithUserSetting("firstname")) {
         $ilUser->setFirstName(ilUtil::stripSlashes($_POST["usr_firstname"]));
     }
     if ($this->workWithUserSetting("lastname")) {
         $ilUser->setLastName(ilUtil::stripSlashes($_POST["usr_lastname"]));
     }
     if ($this->workWithUserSetting("gender")) {
         $ilUser->setGender($_POST["usr_gender"]);
     }
     if ($this->workWithUserSetting("title")) {
         $ilUser->setUTitle(ilUtil::stripSlashes($_POST["usr_title"]));
     }
     $ilUser->setFullname();
     if ($this->workWithUserSetting("institution")) {
         $ilUser->setInstitution(ilUtil::stripSlashes($_POST["usr_institution"]));
     }
     if ($this->workWithUserSetting("department")) {
         $ilUser->setDepartment(ilUtil::stripSlashes($_POST["usr_department"]));
     }
     if ($this->workWithUserSetting("street")) {
         $ilUser->setStreet(ilUtil::stripSlashes($_POST["usr_street"]));
     }
     if ($this->workWithUserSetting("zipcode")) {
         $ilUser->setZipcode(ilUtil::stripSlashes($_POST["usr_zipcode"]));
     }
     if ($this->workWithUserSetting("city")) {
         $ilUser->setCity(ilUtil::stripSlashes($_POST["usr_city"]));
     }
     if ($this->workWithUserSetting("country")) {
         $ilUser->setCountry(ilUtil::stripSlashes($_POST["usr_country"]));
     }
     if ($this->workWithUserSetting("phone_office")) {
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilPersonalProfileGUI.php

示例10: checkInput

 /**
  * Check user's input
  */
 function checkInput($addr_id = 0)
 {
     // check if user login and e-mail-address are empty
     if (!strcmp(trim($_POST["login"]), "") && !strcmp(trim($_POST["email"]), "")) {
         ilUtil::sendInfo($this->lng->txt("mail_enter_login_or_email_addr"));
         $error = true;
     } else {
         if ($_POST["login"] != "" && !ilObjUser::_lookupId(ilUtil::stripSlashes($_POST["login"]))) {
             ilUtil::sendInfo($this->lng->txt("mail_enter_valid_login"));
             $error = true;
         } else {
             if ($_POST["email"] && !ilUtil::is_email($_POST["email"])) {
                 ilUtil::sendInfo($this->lng->txt("mail_enter_valid_email_addr"));
                 $error = true;
             }
         }
     }
     if (($this->existingEntry = $this->abook->checkEntryByLogin(ilUtil::stripSlashes($_POST["login"]))) > 0 && ($this->existingEntry != $addr_id && $addr_id > 0 || !$addr_id)) {
         ilUtil::sendInfo($this->lng->txt("mail_entry_exists"));
         $error = true;
     }
     return $error ? false : true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:26,代码来源:class.ilMailAddressbookGUI.php

示例11: mailUserResults

 function mailUserResults()
 {
     if (!$this->object->hasMailOwnResults()) {
         $this->backToRepository();
     }
     $this->checkAuth(false, true);
     $recipient = $_POST["mail"];
     if (!ilUtil::is_email($recipient)) {
         $this->ctrl->redirect($this, "runShowFinishedPage");
     }
     $survey_gui = new ilObjSurveyGUI();
     $survey_gui->sendUserResultsMail($_SESSION["finished_id"][$this->object->getId()], $recipient);
     ilUtil::sendSuccess($this->lng->txt("mail_sent"), true);
     $this->ctrl->redirect($this, "runShowFinishedPage");
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:15,代码来源:class.ilSurveyExecutionGUI.php

示例12: __validateUserData

 function __validateUserData(&$user_data, $check_complete = true)
 {
     global $lng, $styleDefinition, $ilLog;
     $this->__setMessage('');
     include_once './Services/Authentication/classes/class.ilAuthUtils.php';
     $allow_empty_password = ilAuthUtils::_needsExternalAccountByAuthMode(ilAuthUtils::_getAuthMode($user_data['auth_mode']));
     if ($check_complete) {
         if (!isset($user_data['login'])) {
             $this->__appendMessage('No login given.');
         }
         if (!isset($user_data['passwd']) and !$allow_empty_password) {
             $this->__appendMessage('No password given.');
         }
         if (!isset($user_data['email'])) {
             $this->__appendMessage('No email given');
         }
         if (!isset($user_data['user_language'])) {
             $user_data['user_language'] = $lng->getDefaultLanguage();
         }
     }
     foreach ($user_data as $field => $value) {
         switch ($field) {
             case 'login':
                 if (!ilUtil::isLogin($value)) {
                     $this->__appendMessage('Login invalid.');
                 }
                 // check loginname
                 if ($check_complete) {
                     if (ilObjUser::_loginExists($value)) {
                         $this->__appendMessage('Login already exists.');
                     }
                 }
                 break;
             case 'passwd':
                 if (!strlen($value) and $allow_empty_password) {
                     break;
                 }
                 if (!ilUtil::isPassword($value)) {
                     $this->__appendMessage('Password invalid.');
                 }
                 break;
             case 'email':
                 if (!ilUtil::is_email($value)) {
                     $this->__appendMessage('Email invalid.');
                 }
                 break;
             case 'time_limit_unlimited':
                 if ($value != 1) {
                     if ($user_data['time_limit_from'] >= $user_data['time_limit_until']) {
                         $this->__appendMessage('Time limit invalid');
                     }
                 }
                 break;
             case 'user_language':
                 $lang_inst = $lng->getInstalledLanguages();
                 if (!in_array($user_data['user_language'], $lang_inst)) {
                     $this->__appendMessage('Language: ' . $user_data['user_language'] . ' is not installed');
                 }
                 break;
             case 'user_skin':
             case 'user_style':
                 if ($user_data['user_skin'] and !$user_data['user_style'] or !$user_data['user_skin'] and $user_data['user_style']) {
                     $this->__appendMessage('user_skin, user_style not valid.');
                 } elseif ($user_data['user_skin'] and $user_data['user_style']) {
                     $ok = false;
                     $templates = $styleDefinition->getAllTemplates();
                     if (count($templates) > 0 && is_array($templates)) {
                         foreach ($templates as $template) {
                             $styleDef =& new ilStyleDefinition($template["id"]);
                             $styleDef->startParsing();
                             $styles = $styleDef->getStyles();
                             foreach ($styles as $style) {
                                 if ($user_data['user_skin'] == $template["id"] && $user_data['user_style'] == $style["id"]) {
                                     $ok = true;
                                 }
                             }
                         }
                         if (!$ok) {
                             $this->__appendMessage('user_skin, user_style not valid.');
                         }
                     }
                 }
                 break;
             case 'time_limit_owner':
                 $type = ilObject::_lookupType($user_data['time_limit_owner'], true);
                 if ($type != 'cat' and $type != 'usrf') {
                     $this->__appendMessage('time_limit_owner must be ref_id of category or user folder' . $type);
                 }
                 break;
             default:
                 continue;
         }
     }
     return strlen($this->__getMessage()) ? false : true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:95,代码来源:class.ilSoapUserAdministration.php

示例13: saveSettingsObject

 function saveSettingsObject()
 {
     global $rbacsystem, $ilCtrl;
     $settings = $this->ilias->getAllSettings();
     if (!$rbacsystem->checkAccess("write", $this->object->getRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     //init checking var
     $form_valid = true;
     // moved to privacy/security
     /*if($_POST['https'])
     		{
     			include_once './Services/Http/classes/class.ilHTTPS.php';
     
     			if(!ilHTTPS::_checkHTTPS())
     			{
     				ilUtil::sendInfo($this->lng->txt('https_not_possible'));
     				$form_valid = false;
     			}
     			if(!ilHTTPS::_checkHTTP())
     			{
     				ilUtil::sendInfo($this->lng->txt('http_not_possible'));
     				$form_valid = false;
     			}
     		}*/
     // check required user information
     if (empty($_POST["admin_firstname"]) or empty($_POST["admin_lastname"]) or empty($_POST["admin_street"]) or empty($_POST["admin_zipcode"]) or empty($_POST["admin_country"]) or empty($_POST["admin_city"]) or empty($_POST["admin_phone"]) or empty($_POST["admin_email"])) {
         // feedback
         ilUtil::sendFailure($this->lng->txt("fill_out_all_required_fields"));
         $form_valid = false;
     }
     // check email adresses
     // feedback_recipient
     if (!ilUtil::is_email($_POST["feedback_recipient"]) and !empty($_POST["feedback_recipient"]) and $form_valid) {
         ilUtil::sendFailure($this->lng->txt("input_error") . ": '" . $this->lng->txt("feedback_recipient") . "'<br/>" . $this->lng->txt("email_not_valid"));
         $form_valid = false;
     }
     // error_recipient
     if (!ilUtil::is_email($_POST["error_recipient"]) and !empty($_POST["error_recipient"]) and $form_valid) {
         ilUtil::sendFailure($this->lng->txt("input_error") . ": '" . $this->lng->txt("error_recipient") . "'<br/>" . $this->lng->txt("email_not_valid"));
         $form_valid = false;
     }
     // admin email
     if (!ilUtil::is_email($_POST["admin_email"]) and $form_valid) {
         ilUtil::sendFailure($this->lng->txt("input_error") . ": '" . $this->lng->txt("email") . "'<br/>" . $this->lng->txt("email_not_valid"));
         $form_valid = false;
     }
     // prepare output
     foreach ($_POST as $key => $val) {
         if ($key != "cmd") {
             $_POST[$key] = ilUtil::prepareFormOutput($val, true);
         }
     }
     if (!$form_valid) {
         ////////////////////////////////////////////////////////////
         // load user modified settings again
         // basic data
         $settings["feedback_recipient"] = $_POST["feedback_recipient"];
         $settings["error_recipient"] = $_POST["error_recipient"];
         // modules
         $settings["pub_section"] = $_POST["pub_section"];
         $settings["open_google"] = $_POST["open_google"];
         $settings["default_repository_view"] = $_POST["default_rep_view"];
         $settings["password_assistance"] = $_POST["password_assistance"];
         $settings['short_inst_title'] = $_POST['short_inst_title'];
         $settings["passwd_auto_generate"] = $_POST["password_auto_generate"];
         //$settings["js_edit"] = $_POST["js_edit"];
         $settings["enable_trash"] = $_POST["enable_trash"];
         //$settings["https"] = $_POST["https"];
         //session_reminder
         $settings['session_reminder_enabled'] = (int) $_POST['session_reminder_enabled'];
         // session control
         // contact
         $settings["admin_firstname"] = $_POST["admin_firstname"];
         $settings["admin_lastname"] = $_POST["admin_lastname"];
         $settings["admin_title"] = $_POST["admin_title"];
         $settings["admin_position"] = $_POST["admin_position"];
         $settings["admin_institution"] = $_POST["admin_institution"];
         $settings["admin_street"] = $_POST["admin_street"];
         $settings["admin_zipcode"] = $_POST["admin_zipcode"];
         $settings["admin_city"] = $_POST["admin_city"];
         $settings["admin_country"] = $_POST["admin_country"];
         $settings["admin_phone"] = $_POST["admin_phone"];
         $settings["admin_email"] = $_POST["admin_email"];
         // cron
         $settings["cron_user_check"] = $_POST["cron_user_check"];
         $settings["cron_link_check"] = $_POST["cron_link_check"];
         $settings["cron_web_resource_check"] = $_POST["cron_web_resource_check"];
         $settings["cron_lucene_index"] = $_POST["cron_lucene_index"];
         $settings["forum_notification"] = $_POST["forum_notification"];
         $settings["mail_notification"] = $_POST["mail_notification"];
         $settings["mail_notification_message"] = $_POST["mail_notification_message"];
         // forums
         $settings['frm_store_new'] = $_POST['frm_store_new'];
         // soap
         $settings["soap_user_administration"] = $_POST["soap_user_administration"];
         // data privacy
         /*	$settings["enable_fora_statistics"] = $_POST["enable_fora_statistics"]; */
         $settings["suffix_repl_additional"] = $_POST["suffix_repl_additional"];
         // dynamic links
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilObjSystemFolderGUI.php

示例14: updateObjectOld

 /**
  * Does input checks and updates a user account if everything is fine.
  * @access	public
  */
 function updateObjectOld()
 {
     global $ilias, $rbacsystem, $rbacadmin, $ilUser;
     include_once './Services/Authentication/classes/class.ilAuthUtils.php';
     //load ILIAS settings
     $settings = $ilias->getAllSettings();
     // User folder
     if ($this->usrf_ref_id == USER_FOLDER_ID and !$rbacsystem->checkAccess('visible,read,write', $this->usrf_ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_user"), $this->ilias->error_obj->MESSAGE);
     }
     // if called from local administration $this->usrf_ref_id is category id
     // Todo: this has to be fixed. Do not mix user folder id and category id
     if ($this->usrf_ref_id != USER_FOLDER_ID) {
         // check if user is assigned to category
         if (!$rbacsystem->checkAccess('cat_administrate_users', $this->object->getTimeLimitOwner())) {
             $this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_user"), $this->ilias->error_obj->MESSAGE);
         }
     }
     foreach ($_POST["Fobject"] as $key => $val) {
         $_POST["Fobject"][$key] = ilUtil::stripSlashes($val);
     }
     // check dynamically required fields
     foreach ($settings as $key => $val) {
         $field = substr($key, 8);
         switch ($field) {
             case 'passwd':
             case 'passwd2':
                 if (ilAuthUtils::_allowPasswordModificationByAuthMode(ilAuthUtils::_getAuthMode($_POST['Fobject']['auth_mode']))) {
                     $require_keys[] = $field;
                 }
                 break;
             default:
                 $require_keys[] = $field;
                 break;
         }
     }
     foreach ($require_keys as $key => $val) {
         // exclude required system and registration-only fields
         $system_fields = array("default_role");
         if (!in_array($val, $system_fields)) {
             if (isset($settings["require_" . $val]) && $settings["require_" . $val]) {
                 if (empty($_POST["Fobject"][$val])) {
                     $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields") . ": " . $this->lng->txt($val), $this->ilias->error_obj->MESSAGE);
                 }
             }
         }
     }
     if (!$this->__checkUserDefinedRequiredFields()) {
         $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"), $this->ilias->error_obj->MESSAGE);
     }
     // validate login
     if ($this->object->getLogin() != $_POST["Fobject"]["login"] && !ilUtil::isLogin($_POST["Fobject"]["login"])) {
         $this->ilias->raiseError($this->lng->txt("login_invalid"), $this->ilias->error_obj->MESSAGE);
     }
     // check loginname
     if (ilObjUser::_loginExists($_POST["Fobject"]["login"], $this->id)) {
         $this->ilias->raiseError($this->lng->txt("login_exists"), $this->ilias->error_obj->MESSAGE);
     }
     if (ilAuthUtils::_allowPasswordModificationByAuthMode(ilAuthUtils::_getAuthMode($_POST['Fobject']['auth_mode']))) {
         if ($_POST['Fobject']['passwd'] == "********" and !strlen($this->object->getPasswd())) {
             $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields") . ": " . $this->lng->txt('password'), $this->ilias->error_obj->MESSAGE);
         }
         // check passwords
         if ($_POST["Fobject"]["passwd"] != $_POST["Fobject"]["passwd2"]) {
             $this->ilias->raiseError($this->lng->txt("passwd_not_match"), $this->ilias->error_obj->MESSAGE);
         }
         // validate password
         if (!ilUtil::isPassword($_POST["Fobject"]["passwd"])) {
             $this->ilias->raiseError($this->lng->txt("passwd_invalid"), $this->ilias->error_obj->MESSAGE);
         }
     } else {
         // Password will not be changed...
         $_POST['Fobject']['passwd'] = "********";
     }
     if (ilAuthUtils::_needsExternalAccountByAuthMode(ilAuthUtils::_getAuthMode($_POST['Fobject']['auth_mode']))) {
         if (!strlen($_POST['Fobject']['ext_account'])) {
             $this->ilias->raiseError($this->lng->txt('ext_acccount_required'), $this->ilias->error_obj->MESSAGE);
         }
     }
     if ($_POST['Fobject']['ext_account'] && ($elogin = ilObjUser::_checkExternalAuthAccount($_POST['Fobject']['auth_mode'], $_POST['Fobject']['ext_account']))) {
         if ($elogin != $this->object->getLogin()) {
             $this->ilias->raiseError(sprintf($this->lng->txt("err_auth_ext_user_exists"), $_POST["Fobject"]["ext_account"], $_POST['Fobject']['auth_mode'], $elogin), $this->ilias->error_obj->MESSAGE);
         }
     }
     // The password type is not passed with the post data.  Therefore we
     // append it here manually.
     include_once './Services/User/classes/class.ilObjUser.php';
     $_POST["Fobject"]["passwd_type"] = IL_PASSWD_PLAIN;
     // validate email
     if (strlen($_POST['Fobject']['email']) and !ilUtil::is_email($_POST["Fobject"]["email"])) {
         $this->ilias->raiseError($this->lng->txt("email_not_valid"), $this->ilias->error_obj->MESSAGE);
     }
     $start = $this->__toUnix($_POST["time_limit"]["from"]);
     $end = $this->__toUnix($_POST["time_limit"]["until"]);
     // validate time limit
     if (!$_POST["time_limit"]["unlimited"] and $start > $end) {
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilObjUserGUI.php

示例15: checkInput

 /**
  * Check input, strip slashes etc. set alert, if input is not ok.
  * @return    boolean        Input ok, true/false
  */
 function checkInput()
 {
     global $lng;
     $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()], !(bool) $this->allowRFC822);
     $_POST[$this->getPostVar() . '_retype'] = ilUtil::stripSlashes($_POST[$this->getPostVar() . '_retype'], !(bool) $this->allowRFC822);
     if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
         $this->setAlert($lng->txt("msg_input_is_required"));
         return false;
     }
     if ($this->getRetype() && $_POST[$this->getPostVar()] != $_POST[$this->getPostVar() . '_retype']) {
         $this->setAlert($lng->txt('email_not_match'));
         return false;
     }
     if (!ilUtil::is_email($_POST[$this->getPostVar()]) && trim($_POST[$this->getPostVar()]) != "") {
         $this->setAlert($lng->txt("email_not_valid"));
         return false;
     }
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilEMailInputGUI.php


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