コード例 #1
0
ファイル: index.php プロジェクト: harriswong/AContent
    require TR_INCLUDE_PATH . 'header.inc.php';
    $msg->printInfos('INVALID_USER');
    require TR_INCLUDE_PATH . 'footer.inc.php';
    exit;
}
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    Header('Location: ../index.php');
    exit;
}
if (isset($_POST['submit'])) {
    if (isset($_POST['is_author'])) {
        $is_author = 1;
    } else {
        $is_author = 0;
    }
    $usersDAO = new UsersDAO();
    $user_row = $usersDAO->getUserByID($_SESSION['user_id']);
    if ($usersDAO->Update($_SESSION['user_id'], $user_row['user_group_id'], $user_row['login'], $user_row['email'], $_POST['first_name'], $_POST['last_name'], $is_author, $_POST['organization'], $_POST['phone'], $_POST['address'], $_POST['city'], $_POST['province'], $_POST['country'], $_POST['postal_code'], $_POST['status'])) {
        $msg->addFeedback('PROFILE_UPDATED');
    }
}
$row = $_current_user->getInfo();
if (!isset($_POST['submit'])) {
    $_POST = $row;
}
/* template starts here */
$savant->assign('row', $row);
global $onload;
$onload = 'document.form.first_name.focus();';
$savant->display('profile/index.tmpl.php');
コード例 #2
0
                        /* send the email confirmation message: */
                        require AC_INCLUDE_PATH . 'classes/phpmailer/acheckermailer.class.php';
                        $mail = new ACheckerMailer();
                        $mail->From = $_config['contact_email'];
                        $mail->AddAddress($_POST['email']);
                        $mail->Subject = SITE_NAME . ' - ' . _AC('email_confirmation_subject');
                        $mail->Body = _AC('email_confirmation_message', SITE_NAME, $confirmation_link) . "\n\n";
                        $mail->Send();
                    } else {
                        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
                        header('Location: index.php');
                        exit;
                    }
                }
            } else {
                if ($usersDAO->Update($_GET['id'], $_POST['user_group_id'], $_POST['login'], $_POST['email'], $_POST['first_name'], $_POST['last_name'], $_POST['status'])) {
                    $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
                    header('Location: index.php');
                    exit;
                }
            }
        }
    }
}
// end of handle submit
// initialize page
$userGroupsDAO = new UserGroupsDAO();
if (isset($_GET['id'])) {
    $usersDAO = new UsersDAO();
    $savant->assign('user_row', $usersDAO->getUserByID($_GET['id']));
    $savant->assign('show_password', false);
コード例 #3
0
 public static function Update($id, $password, $email, $hoten, $gioitinh, $diachi, $sdt1, $sdt2, $role, $level, $status = 1, $updatedate, $ip)
 {
     $password = md5($password);
     $email = addslashes($email);
     return UsersDAO::Update($id, $password, $email, $hoten, $gioitinh, $diachi, $sdt1, $sdt2, $role, $level, $status, $updatedate, $ip);
 }