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


PHP UserPeer::loadUserByUsername方法代码示例

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


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

示例1: setError

     setError(t("please_enter_your_email_address", "Please enter your email address"));
 } elseif ($emailAddress != $emailAddressConfirm) {
     setError(t("your_email_address_confirmation_does_not_match", "Your email address confirmation does not match"));
 } elseif (!valid_email($emailAddress)) {
     setError(t("your_email_address_is_invalid", "Your email address is invalid"));
 } elseif (!strlen($username)) {
     setError(t("please_enter_your_preferred_username", "Please enter your preferred username"));
 } elseif (strlen($username) < 6 || strlen($username) > 20) {
     setError(t("username_must_be_between_6_and_20_characters", "Your username must be between 6 and 20 characters"));
 } else {
     $checkEmail = UserPeer::loadUserByEmailAddress($emailAddress);
     if ($checkEmail) {
         // username exists
         setError(t("email_address_already_exists", "Email address already exists on another account"));
     } else {
         $checkUser = UserPeer::loadUserByUsername($username);
         if ($checkUser) {
             // username exists
             setError(t("username_already_exists", "Username already exists on another account"));
         }
     }
 }
 // create the account
 if (!isErrors()) {
     $newPassword = createPassword();
     $newUser = UserPeer::create($username, $newPassword, $emailAddress, $title, $firstname, $lastname);
     if ($newUser) {
         $subject = "Account details for " . SITE_CONFIG_SITE_NAME;
         $plainMsg = "Dear " . $firstname . ",\n\n";
         $plainMsg .= "Your account on " . SITE_CONFIG_SITE_NAME . " has be created. Use the details below to login to your new account:\n\n";
         $plainMsg .= "<strong>Url:</strong> <a href='" . WEB_ROOT . "'>" . WEB_ROOT . "</a>\n";
开发者ID:farzam65,项目名称:YetiShare-File-Hosting-Script-Free,代码行数:31,代码来源:register.php


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