本文整理匯總了PHP中unknown_type::setPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP unknown_type::setPassword方法的具體用法?PHP unknown_type::setPassword怎麽用?PHP unknown_type::setPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類unknown_type
的用法示例。
在下文中一共展示了unknown_type::setPassword方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: EventProfile
//.........這裏部分代碼省略.........
$this->oUserCurrent->setProfileIcq(null);
}
/**
* Проверяем сайт
*/
if (func_check(getRequest('profile_site'), 'text', 3, 200)) {
$this->oUserCurrent->setProfileSite(getRequest('profile_site'));
} else {
$this->oUserCurrent->setProfileSite(null);
}
/**
* Проверяем название сайта
*/
if (func_check(getRequest('profile_site_name'), 'text', 3, 50)) {
$this->oUserCurrent->setProfileSiteName(getRequest('profile_site_name'));
} else {
$this->oUserCurrent->setProfileSiteName(null);
}
/**
* Проверяем информацию о себе
*/
if (func_check(getRequest('profile_about'), 'text', 1, 3000)) {
$this->oUserCurrent->setProfileAbout(getRequest('profile_about'));
} else {
$this->oUserCurrent->setProfileAbout(null);
}
/**
* Проверка на смену пароля
*/
if (getRequest('password', '') != '') {
if (func_check(getRequest('password'), 'password', 5)) {
if (getRequest('password') == getRequest('password_confirm')) {
if (func_encrypt(getRequest('password_now')) == $this->oUserCurrent->getPassword()) {
$this->oUserCurrent->setPassword(func_encrypt(getRequest('password')));
} else {
$bError = true;
$this->Message_AddError($this->Lang_Get('settings_profile_password_current_error'), $this->Lang_Get('error'));
}
} else {
$bError = true;
$this->Message_AddError($this->Lang_Get('settings_profile_password_confirm_error'), $this->Lang_Get('error'));
}
} else {
$bError = true;
$this->Message_AddError($this->Lang_Get('settings_profile_password_new_error'), $this->Lang_Get('error'));
}
}
/**
* Загрузка аватара, делаем ресайзы
*/
if (isset($_FILES['avatar']) and is_uploaded_file($_FILES['avatar']['tmp_name'])) {
/**
* Получаем список текущих аватаров
*/
$sPathOld = $this->oUserCurrent->getProfileAvatar();
$aUserAvatars = array();
if ($sPathOld) {
foreach (array_merge(Config::Get('module.user.avatar_size'), array(100)) as $iSize) {
$aUserAvatars[$iSize] = $this->oUserCurrent->getProfileAvatarPath($iSize);
}
}
if ($sPath = $this->User_UploadAvatar($_FILES['avatar'], $this->oUserCurrent)) {
$this->oUserCurrent->setProfileAvatar($sPath);
/**
* Удаляем старые, если путь не совпадает с текущими аватарками
*/
示例2: submitEditForum
/**
* Обработка отправки формы при редактировании форума
*
* @param unknown_type $oForum
*/
protected function submitEditForum($oForum = null)
{
$sNewType = isPost('f_type') ? getRequestStr('f_type') : 'forum';
/**
* Обновляем свойства форума
*/
$oForum->setTitle(forum_parse_title(getRequestStr('forum_title')));
$oForum->setUrl(preg_replace("/\\s+/", '_', trim(getRequestStr('forum_url', ''))));
if ($sNewType == 'category') {
$oForum->setCanPost(1);
} else {
$oForum->setDescription(getRequestStr('forum_description'));
$oForum->setParentId(getRequestStr('forum_parent'));
$oForum->setType(getRequestStr('forum_type'));
$oForum->setCanPost((int) getRequest('forum_sub_can_post', 0, 'post') === 1);
$oForum->setQuickReply((int) getRequest('forum_quick_reply', 0, 'post') === 1);
$oForum->setPassword(getRequestStr('forum_password'));
$oForum->setSort(getRequestStr('forum_sort'));
$oForum->setRedirectUrl(getRequestStr('forum_redirect_url'));
if (isPost('forum_redirect_url')) {
$oForum->setRedirectOn((int) getRequest('forum_redirect_on', 0, 'post') === 1);
}
$oForum->setLimitRatingTopic((double) getRequest('forum_limit_rating_topic'));
/**
* Опции
*/
if (isPost('forum_display_subforum_list')) {
$oForum->setOptionsValue('display_subforum_list', (int) getRequest('forum_display_subforum_list', 0, 'post') === 1);
}
if (isPost('forum_display_on_index')) {
$oForum->setOptionsValue('display_on_index', (int) getRequest('forum_display_on_index', 0, 'post') === 1);
}
if (isPost('forum_topics_per_page')) {
$oForum->setOptionsValue('topics_per_page', getRequestStr('forum_topics_per_page'));
}
if (isPost('forum_posts_per_page')) {
$oForum->setOptionsValue('posts_per_page', getRequestStr('forum_posts_per_page'));
}
/**
* Копируем права доступа
*/
if (getRequest('forum_perms')) {
if ($oCopyForum = $this->PluginForum_Forum_GetForumById(getRequestStr('forum_perms'))) {
$oForum->setPermissions($oCopyForum->getPermissions());
}
}
/**
* Загружаем иконку
*/
if (isset($_FILES['forum_icon']) && is_uploaded_file($_FILES['forum_icon']['tmp_name'])) {
if ($sPath = $this->PluginForum_Forum_UploadIcon($_FILES['forum_icon'], $oForum)) {
$oForum->setIcon($sPath);
} else {
$this->Message_AddError($this->Lang_Get('plugin.forum.create_icon_error'), $this->Lang_Get('error'));
return false;
}
}
/**
* Удаляем иконку
*/
if (isset($_REQUEST['forum_icon_delete'])) {
$this->PluginForum_Forum_DeleteIcon($oForum);
$oForum->setIcon(null);
}
}
/**
* Проверяем корректность полей
*/
if (!$this->checkForumFields($oForum)) {
return;
}
/**
* Вызов хуков
*/
$this->Hook_Run('forum_edit_before', array('oForum' => $oForum));
/**
* Сохраняем форум
*/
if ($this->PluginForum_Forum_SaveForum($oForum)) {
$this->Hook_Run('forum_edit_after', array('oForum' => $oForum));
$this->Message_AddNotice($this->Lang_Get('plugin.forum.edit_ok'), null, 1);
} else {
$this->Message_AddError($this->Lang_Get('system_error'), null, 1);
}
if (isPost('submit_forum_save_next_perms')) {
Router::Location(Router::GetPath('forum') . "admin/forums/perms/{$oForum->getId()}");
} else {
Router::Location(Router::GetPath('forum') . 'admin/forums/');
}
}