Example #1
0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
******************************************************************************/
$smarty->assign('email', $_SESSION['email']);
if (isset($_POST['u_submit'])) {
    if (!isset($_POST['new_passwd1']) || empty($_POST['new_passwd1']) || !isset($_POST['new_passwd2']) || empty($_POST['new_passwd2'])) {
        $smarty->assign('error_msg', 'y');
        $smarty->assign('if_error_password_empty', 'y');
    } else {
        if (check_passwd_length($_POST['new_passwd2']) == false) {
            $smarty->assign('error_msg', 'y');
            $smarty->assign('if_error_password_long', 'y');
        } else {
            if ($_POST['new_passwd1'] != $_POST['new_passwd2']) {
                $smarty->assign('error_msg', 'y');
                $smarty->assign('if_new_passwd_not_same', 'y');
            } else {
                if (decrypt_passwd($_SESSION['cpasswd']) != $_POST['old_passwd']) {
                    $smarty->assign('error_msg', 'y');
                    $smarty->assign('if_error_password_old_wrong', 'y');
                } else {
                    if ($config['cleartext_passwd'] == 1) {
                        $cleartext = $_POST['new_passwd1'];
                    } else {
                        $cleartext = "";
Example #2
0
 } else {
     if (!email_valid($_POST['emailaddr'])) {
         $smarty->assign('error_msg', 'y');
         $smarty->assign('if_email_valid', 'y');
         $smarty->assign('if_valid', 'n');
         $smarty->assign('eMail', $_POST['emailaddr']);
         $smarty->assign('full_name', $_POST['full_name']);
     } else {
         if (email_exist($full_email, $db, 0, 0)) {
             $smarty->assign('error_msg', 'y');
             $smarty->assign('if_error_email_exits', 'y');
             $smarty->assign('full_email', 'y');
             $smarty->assign('eMail', $_POST['emailaddr']);
             $smarty->assign('full_name', $_POST['full_name']);
         } else {
             if (check_passwd_length($_POST['npassword']) == false) {
                 $smarty->assign('error_msg', 'y');
                 $smarty->assign('if_error_password_long', 'y');
                 $smarty->assign('eMail', $_POST['emailaddr']);
                 $smarty->assign('full_name', $_POST['full_name']);
             } else {
                 if (isset($_POST['imap']) && $_POST['imap'] == "1" && check_domain_feature($_GET['did'], 'p_imap', $db)) {
                     $imap = "1";
                 } else {
                     $imap = "0";
                 }
                 if (isset($_POST['pop3']) && $_POST['pop3'] == "1" && check_domain_feature($_GET['did'], 'p_pop3', $db)) {
                     $pop3 = "1";
                 } else {
                     $pop3 = "0";
                 }
Example #3
0
$smarty->assign('id', $data['id']);
$smarty->assign('full_name', $data['full_name']);
$smarty->assign('username', $data['username']);
$smarty->assign('access', $data['access']);
$smarty->assign('manager', $data['manager']);
$_POST['username'] = $data['username'];
if (empty($_POST['passwd'])) {
    $passwd = $data['passwd'];
    $cpasswd = $data['cpasswd'];
} else {
    $passwd = $_POST['passwd'];
    $cpasswd = crypt($_POST['passwd']);
}
if (isset($_POST['submit'])) {
    $wrong = 0;
    if (!empty($_POST['passwd']) && check_passwd_length($passwd) == false) {
        $smarty->assign('error_msg', 'y');
        $smarty->assign('if_error_password_long', 'y');
        $wrong = 1;
    } elseif (adm_user_exits($_POST['username'], $_GET['id'], $db)) {
        $smarty->assign('error_msg', 'y');
        $smarty->assign('if_error_sadmim_exits', 'y');
        $wrong = 1;
    } else {
        $sql = sprintf("DELETE FROM adm_users WHERE id='%s'", $db->escapeSimple($_GET['id']));
        $res =& $db->query($sql);
        $cleartext = "";
        if ($config['cleartext_passwd'] == 1) {
            $cleartext = $passwd;
        }
        $sql = sprintf("INSERT INTO adm_users SET username='******', passwd='%s', full_name='%s', access='%d', manager='%d', id='%d', cpasswd='%s'", $db->escapeSimple($data['username']), $db->escapeSimple($cleartext), $db->escapeSimple($_POST['full_name']), $db->escapeSimple($_POST['access']), $db->escapeSimple($_POST['manager']), $db->escapeSimple($_GET['id']), $db->escapeSimple($cpasswd));
Example #4
0
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
******************************************************************************/
if (isset($_POST['submit'])) {
    $wrong = 0;
    if (empty($_POST['username']) || !isset($_POST['username'])) {
        $smarty->assign('error_msg', 'y');
        $smarty->assign('if_error_missing_input', 'y');
        $wrong = 1;
    } elseif (!ereg("^([a-zA-Z0-9]+)\$", $_POST['username'])) {
        $smarty->assign('error_msg', 'y');
        $smarty->assign('if_sadmin_wrong_char', 'y');
        $smarty->assign('if_username_wrong', 'y');
        $wrong = 1;
    } elseif (check_passwd_length($_POST['passwd']) == false) {
        $smarty->assign('error_msg', 'y');
        $smarty->assign('if_error_password_long', 'y');
        $wrong = 1;
    } elseif (adm_user_exits($_POST['username'], 0, $db)) {
        $smarty->assign('error_msg', 'y');
        $smarty->assign('if_error_sadmim_exits', 'y');
        $smarty->assign('if_user_exits', 'y');
        $wrong = 1;
    } else {
        if ($_POST['access'] == "1") {
            $access = '1';
        } else {
            $access = '0';
        }
        if ($_POST['manager'] == "1") {