示例#1
0
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsAdmin()) {
    $objAdmin = new Admins($objLogin->GetLoggedID());
    $submit_type = isset($_POST['submit_type']) ? prepare_input($_POST['submit_type']) : '';
    $preferred_language = isset($_POST['preferred_language']) ? prepare_input($_POST['preferred_language']) : '';
    $admin_email = isset($_POST['admin_email']) ? prepare_input($_POST['admin_email']) : '';
    $password_one = isset($_POST['password_one']) ? prepare_input($_POST['password_one']) : '';
    $password_two = isset($_POST['password_two']) ? prepare_input($_POST['password_two']) : '';
    $first_name = isset($_POST['first_name']) ? prepare_input($_POST['first_name']) : '';
    $last_name = isset($_POST['last_name']) ? prepare_input($_POST['last_name']) : '';
    $msg = '';
    // change password
    if ($submit_type == '1') {
        $msg = $objAdmin->ChangeLang($preferred_language);
    } else {
        if ($submit_type == '2') {
            $msg = $objAdmin->SavePersonalInfo($admin_email, $first_name, $last_name);
        } else {
            if ($submit_type == '3') {
                $msg = $objAdmin->ChangePassword($password_one, $password_two);
            }
        }
    }
    draw_title_bar(prepare_breadcrumbs(array(_ACCOUNTS => '', _MY_ACCOUNT => '')));
    if ($msg == '') {
        draw_message(_ALERT_REQUIRED_FILEDS);
    } else {
        echo $msg;
    }