} else { $arr['email'] = db_string($email); } } if ($chpasswd_val) { global $passwd, $passwd_confirm; if ($passwd != $passwd_confirm) { add_info('Ошибка подтверждеия пароля. Пароль не был обновлен.'); } else { $arr['password'] = '******' . addslashes(user_password_hash(user_login(), stripslashes($passwd))) . '")'; } } if (count($arr) > 0) { db_update('user', $arr, '`id`=' . user_id()); if (isset($arr['password'])) { user_authorize(user_login(), stripslashes($passwd)); } } } $u = user_get_by_id(user_id()); $f = new CVCForm(); $f->Init('', 'action=.?action\\=save' . ($redirect != '' ? '&redirect=' . prepare_arg($redirect) . ';backlink=' . prepare_arg($redirect) : '') . ';method=POST;add_check_func=check;'); $f->AppendLabelField('Имя пользователя', '', $u['name']); $f->AppendLabelField('Логин', '', $u['login']); if ($u['email'] != '') { $f->AppendCustomField(array('src' => '<table class="clear" width="100%"><tr><td width="30%">E-Mail</td><td><input id="email" name="email" type="text" class="txt block" value="' . htmlspecialchars($u['email']) . '"></td></tr></table>' . '<button class="block" type="button" onclick="check_frm_email ();" style="margin-top: 4px;">Проверить</button>' . '<div id="email_check_res" style="display: none;"></div>')); } $f->AppendCustomField(array('title' => '<input type="checkbox" class="cb pointer" value="1" onclick="fchpasswd (this);" id="chpasswd" name="chpasswd_val"><span class="pointer" onclick="var e=getElementById (\'chpasswd\'); e.checked=!e.checked; fchpasswd (e);">Сменить пароль</span>', 'src' => '<div id="passwd_block" class="invisible">' . '<table class="clear" width="100%"><tr><td width="85">Новый пароль</td><td style="padding-bottom: 2px;"><input type="password" class="txt block" id="passwd" name="passwd" onkeyup="check_passwd ();" onchange="check_passwd ();"></td></tr>' . '<tr><td>Подтверждение</td><td style="padding-top: 2px;"><input type="password" class="txt block" id="passwd_confirm" name="passwd_confirm" onkeyup="check_passwd ();" onchange="check_passwd ();"></td></tr>' . '</table><div id="passwd_msg"></div></div>')); ?> <script language="JavaScript" type="text/JavaScript">
* * Login form generation script * * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**> * * This program can be distributed under the terms of the GNU GPL. * See the file COPYING. */ if ($PHP_SELF != '') { print 'HACKERS?'; die; } global $login, $passwd; $authorized = false; if (trim($login) != '') { if (user_authorize(stripslashes($login), stripslashes($passwd))) { header('Location: content'); $authorized = true; } } if (!$authorized) { add_body_handler('onload', 'getElementById ("login").focus'); ?> <div id="navigator">Административный интерфейс</div> <form action="." method="POST"> <div class="form" style="width: 460px; margin-left: 40px;"> <div class="content"> <div id="navigator">Введите ваше имя пользователя и пароль</div> <div class="contentSub"><span class="arr">Для работы в административном интерфейсе сайта «<a href="<?php echo config_get('document-root'); ?>
function check_locked() { global $login, $passwd; if (!opt_get('site_lock')) { return false; } if ($login != '') { user_authorize($login, $passwd); } if (user_access_root()) { return false; } tplp('common/site_lock'); return true; }