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


PHP UserModel::NoEmail方法代码示例

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


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

示例1: EntryController_Register_Create

 public function EntryController_Register_Create($Sender)
 {
     if (!$Sender->Request->IsPostBack()) {
         $Sender->CheckOverride('Register', $Sender->Target());
     }
     $Sender->FireEvent("Register");
     $Sender->Form->SetModel($Sender->UserModel);
     // Define gender dropdown options
     $Sender->GenderOptions = array('u' => T('Unspecified'), 'm' => T('Male'), 'f' => T('Female'));
     // Make sure that the hour offset for new users gets defined when their account is created
     $Sender->AddJsFile('entry.js');
     $Sender->Form->AddHidden('ClientHour', date('Y-m-d H:00'));
     // Use the server's current hour as a default
     $Sender->Form->AddHidden('Target', $Sender->Target());
     $Sender->SetData('NoEmail', UserModel::NoEmail());
     $RegistrationMethod = 'RegisterBasic';
     $Sender->View = $RegistrationMethod;
     $Sender->{$RegistrationMethod}($InvitationCode);
 }
开发者ID:er0k,项目名称:trickno,代码行数:19,代码来源:class.chat.plugin.php

示例2: Register

 /**
  * Calls the appropriate registration method based on the configuration setting.
  *
  * Events: Register
  *
  * @access public
  * @since 2.0.0
  *
  * @param string $InvitationCode Unique code given to invited user.
  */
 public function Register($InvitationCode = '')
 {
     $this->FireEvent("Register");
     $this->Form->SetModel($this->UserModel);
     // Define gender dropdown options
     $this->GenderOptions = array('u' => T('Unspecified'), 'm' => T('Male'), 'f' => T('Female'));
     // Make sure that the hour offset for new users gets defined when their account is created
     $this->AddJsFile('entry.js');
     $this->Form->AddHidden('ClientHour', date('Y-m-d H:00'));
     // Use the server's current hour as a default
     $this->Form->AddHidden('Target', $this->Target());
     $this->SetData('NoEmail', UserModel::NoEmail());
     $RegistrationMethod = $this->_RegistrationView();
     $this->View = $RegistrationMethod;
     $this->{$RegistrationMethod}($InvitationCode);
 }
开发者ID:elpum,项目名称:TgaForumBundle,代码行数:26,代码来源:class.entrycontroller.php

示例3: Preferences

 /**
  * Edit user's preferences (mostly notification settings).
  *
  * @since 2.0.0
  * @access public
  * @param mixed $UserReference Unique identifier, possibly username or ID.
  * @param string $Username.
  * @param int $UserID Unique identifier.
  */
 public function Preferences($UserReference = '', $Username = '', $UserID = '')
 {
     $this->AddJsFile('profile.js');
     $Session = Gdn::Session();
     $this->Permission('Garden.SignIn.Allow');
     // Get user data
     $this->GetUserInfo($UserReference, $Username, $UserID, TRUE);
     $UserPrefs = Gdn_Format::Unserialize($this->User->Preferences);
     if ($this->User->UserID != $Session->UserID) {
         $this->Permission(array('Garden.Users.Edit', 'Moderation.Profiles.Edit'), FALSE);
     }
     if (!is_array($UserPrefs)) {
         $UserPrefs = array();
     }
     $MetaPrefs = UserModel::GetMeta($this->User->UserID, 'Preferences.%', 'Preferences.');
     // Define the preferences to be managed
     $this->Preferences = array('Notifications' => array('Email.WallComment' => T('Notify me when people write on my wall.'), 'Email.ActivityComment' => T('Notify me when people reply to my wall comments.'), 'Popup.WallComment' => T('Notify me when people write on my wall.'), 'Popup.ActivityComment' => T('Notify me when people reply to my wall comments.')));
     // Allow email notification of applicants (if they have permission & are using approval registration)
     if (CheckPermission('Garden.Users.Approve') && C('Garden.Registration.Method') == 'Approval') {
         $this->Preferences['Notifications']['Email.Applicant'] = array(T('NotifyApplicant', 'Notify me when anyone applies for membership.'), 'Meta');
     }
     $this->FireEvent('AfterPreferencesDefined');
     // Loop through the preferences looking for duplicates, and merge into a single row
     $this->PreferenceGroups = array();
     $this->PreferenceTypes = array();
     foreach ($this->Preferences as $PreferenceGroup => $Preferences) {
         $this->PreferenceGroups[$PreferenceGroup] = array();
         $this->PreferenceTypes[$PreferenceGroup] = array();
         foreach ($Preferences as $Name => $Description) {
             $Location = 'Prefs';
             if (is_array($Description)) {
                 list($Description, $Location) = $Description;
             }
             $NameParts = explode('.', $Name);
             $PrefType = GetValue('0', $NameParts);
             $SubName = GetValue('1', $NameParts);
             if ($SubName != FALSE) {
                 // Save an array of all the different types for this group
                 if (!in_array($PrefType, $this->PreferenceTypes[$PreferenceGroup])) {
                     $this->PreferenceTypes[$PreferenceGroup][] = $PrefType;
                 }
                 // Store all the different subnames for the group
                 if (!array_key_exists($SubName, $this->PreferenceGroups[$PreferenceGroup])) {
                     $this->PreferenceGroups[$PreferenceGroup][$SubName] = array($Name);
                 } else {
                     $this->PreferenceGroups[$PreferenceGroup][$SubName][] = $Name;
                 }
             } else {
                 $this->PreferenceGroups[$PreferenceGroup][$Name] = array($Name);
             }
         }
     }
     // Loop the preferences, setting defaults from the configuration.
     $CurrentPrefs = array();
     foreach ($this->Preferences as $PrefGroup => $Prefs) {
         foreach ($Prefs as $Pref => $Desc) {
             $Location = 'Prefs';
             if (is_array($Desc)) {
                 list($Desc, $Location) = $Desc;
             }
             if ($Location == 'Meta') {
                 $CurrentPrefs[$Pref] = GetValue($Pref, $MetaPrefs, FALSE);
             } else {
                 $CurrentPrefs[$Pref] = GetValue($Pref, $UserPrefs, C('Preferences.' . $Pref, '0'));
             }
             unset($MetaPrefs[$Pref]);
         }
     }
     $CurrentPrefs = array_merge($CurrentPrefs, $MetaPrefs);
     $CurrentPrefs = array_map('intval', $CurrentPrefs);
     $this->SetData('Preferences', $CurrentPrefs);
     if (UserModel::NoEmail()) {
         $this->PreferenceGroups = self::_RemoveEmailPreferences($this->PreferenceGroups);
         $this->PreferenceTypes = self::_RemoveEmailPreferences($this->PreferenceTypes);
         $this->SetData('NoEmail', TRUE);
     }
     $this->SetData('PreferenceGroups', $this->PreferenceGroups);
     $this->SetData('PreferenceTypes', $this->PreferenceTypes);
     $this->SetData('PreferenceList', $this->Preferences);
     if ($this->Form->AuthenticatedPostBack()) {
         // Get, assign, and save the preferences.
         $NewMetaPrefs = array();
         foreach ($this->Preferences as $PrefGroup => $Prefs) {
             foreach ($Prefs as $Pref => $Desc) {
                 $Location = 'Prefs';
                 if (is_array($Desc)) {
                     list($Desc, $Location) = $Desc;
                 }
                 $Value = $this->Form->GetValue($Pref, NULL);
                 if (is_null($Value)) {
                     continue;
//.........这里部分代码省略.........
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:101,代码来源:class.profilecontroller.php

示例4: SigninLabelCode

 public static function SigninLabelCode()
 {
     return UserModel::NoEmail() ? 'Username' : 'Email/Username';
 }
开发者ID:statico,项目名称:openshift-origin-vanillaforums,代码行数:4,代码来源:class.usermodel.php

示例5: array

<ul>
   <li class="User-Name">
      <?php 
echo $this->Form->Label('Username', 'Name');
$Attributes = array();
if (!$this->Data('_CanEditUsername')) {
    $Attributes['disabled'] = 'disabled';
}
echo $this->Form->TextBox('Name', $Attributes);
?>
   </li>
   
   <li class="User-Email">
      <?php 
echo $this->Form->Label('Email', 'Email');
if (!$this->Data('_CanEditEmail') && UserModel::NoEmail()) {
    echo '<div class="Gloss">', T('Email addresses are disabled.', 'Email addresses are disabled. You can only add an email address if you are an administrator.'), '</div>';
} else {
    $EmailAttributes = array();
    if (!$this->Data('_CanEditEmail')) {
        $EmailAttributes['disabled'] = 'disabled';
    }
    // Email confirmation
    if (!$this->Data('_EmailConfirmed')) {
        $EmailAttributes['class'] = 'InputBox Unconfirmed';
    }
    echo $this->Form->TextBox('Email', $EmailAttributes);
}
?>
   </li>
   
开发者ID:bishopb,项目名称:vanilla,代码行数:30,代码来源:edit.php

示例6: T

if ($this->Data('AllowEditing')) {
    ?>
   <ul>
      <li>
         <?php 
    echo $this->Form->Label('Username', 'Name');
    echo $this->Form->TextBox('Name');
    ?>
      </li>
      <?php 
    if (Gdn::Session()->CheckPermission('Garden.PersonalInfo.View')) {
        ?>
      <li>
         <?php 
        echo $this->Form->Label('Email', 'Email');
        if (UserModel::NoEmail()) {
            echo '<div class="Gloss">', T('Email addresses are disabled.', 'Email addresses are disabled. You can only add an email address if you are an administrator.'), '</div>';
        }
        $EmailAttributes = array();
        // Email confirmation
        if (!$this->Data('_EmailConfirmed')) {
            $EmailAttributes['class'] = 'InputBox Unconfirmed';
        }
        echo $this->Form->TextBox('Email', $EmailAttributes);
        ?>
      </li>
      <?php 
        if ($this->Data('_CanConfirmEmail')) {
            ?>
      <li class="User-ConfirmEmail">
         <?php 
开发者ID:bishopb,项目名称:vanilla,代码行数:31,代码来源:edit.php


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