本文整理汇总了PHP中UserModel::noEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::noEmail方法的具体用法?PHP UserModel::noEmail怎么用?PHP UserModel::noEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel::noEmail方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
echo $this->Form->label('Username', 'Name');
$Attributes = array();
if (!$this->data('_CanEditUsername')) {
$Attributes['disabled'] = 'disabled';
}
echo $this->Form->textBox('Name', $Attributes);
?>
</li>
<?php
if ($this->data('_CanViewPersonalInfo')) {
?>
<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>
<?php
示例2: signinLabelCode
/**
*
*
* @return string
*/
public static function signinLabelCode()
{
return UserModel::noEmail() ? 'Username' : 'Email/Username';
}
示例3: array
>
<th><?php
echo $Role['Name'];
?>
</th>
<td class="Alt">
<?php
echo $this->Form->DropDown('InvitationCount[]', $this->InvitationOptions, array('value' => $CurrentValue));
echo $this->Form->Hidden('InvitationRoleID[]', array('value' => $Role['RoleID']));
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</li>
<li>
<div class="Info">
<?php
if (UserModel::noEmail()) {
echo '<div class="Warning">', t('Email addresses are disabled.', 'Email addresses are disabled. You can only add an email address if you are an administrator.'), '</div>';
}
echo $this->Form->checkBox('Garden.Registration.ConfirmEmail', '@' . t('Confirm email addresses', 'Require users to confirm their email addresses (recommended)'));
?>
</div>
</li>
</ul>
<?php
echo $this->Form->close('Save');
示例4: 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 = '')
{
if (!$this->Request->isPostBack()) {
$this->checkOverride('Register', $this->target());
}
$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->setData('Method', stringBeginsWith($RegistrationMethod, 'Register', false, true));
$this->{$RegistrationMethod}($InvitationCode);
}
示例5: 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
$Notifications = array();
if (c('Garden.Profile.ShowActivities', true)) {
$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.'));
}
$this->Preferences = array('Notifications' => $Notifications);
// 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 = val('0', $NameParts);
$SubName = val('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] = val($Pref, $MetaPrefs, false);
} else {
$CurrentPrefs[$Pref] = val($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;
//.........这里部分代码省略.........