Example #1
0
/**
 * Validate data
 */
$errorLocation = "../admin/user_pwd_reset_form.php?id_user="******"id_user"]);
// controlling var
require_once "../model/Query/User.php";
$user = new User();
$user->setIdUser($_POST["id_user"]);
$user->setLogin($_POST["login"]);
$user->setPwd($_POST["md5"]);
$_POST["pwd"] = "";
$user->setPwd2($_POST["md5_confirm"]);
$_POST["pwd2"] = "";
if (!$user->validatePwd()) {
    $formError["pwd"] = $user->getPwdError();
    Form::setSession($_POST, $formError);
    header("Location: " . $errorLocation);
    exit;
}
/**
 * Destroy form values and errors
 */
Form::unsetSession();
/**
 * Update user
 */
$userQ = new Query_User();
$userQ->resetPwd($user);
FlashMsg::add(sprintf(_("Password of user, %s, has been reset."), $user->getLogin()));
$userQ->close();
unset($userQ);
Example #2
0
                $userQ->close();
                $_SESSION = array();
                // deregister all current session variables
                FlashMsg::add(_("Your user account has been suspended. Contact with administrator to resolve this problem."), OPEN_MSG_WARNING);
                header("Location: ../home/index.php");
                exit;
            }
        }
    }
    $userQ->close();
}
/**
 * Redirect back to form if an error occurred
 */
if ($errorFound) {
    Form::setSession(Check::safeArray($_POST), $formError);
    $_SESSION['auth']['last_login'] = $loginSession;
    if (isset($sessLoginAttempts)) {
        $_SESSION['auth']['login_attempts'] = $sessLoginAttempts;
    }
    header("Location: ../auth/login_form.php");
    exit;
}
/**
 * Redirect to index page if suspended
 */
if (!$user->isActived()) {
    $_SESSION = array();
    // deregister all current session variables
    FlashMsg::add(_("Your user account has been suspended. Contact with administrator to resolve this problem."), OPEN_MSG_WARNING);
    header("Location: ../home/index.php");
 */
require_once "../auth/login_check.php";
loginCheck(OPEN_PROFILE_ADMINISTRATOR, false);
// Not in DEMO to prevent users' malice // We'll see
require_once "../lib/Form.php";
if (count($_POST) > 0) {
    Form::compareToken($returnLocation);
}
require_once "../lib/Check.php";
if (!empty($_FILES['css_filename']['name']) && $_FILES['css_filename']['size'] > 0) {
    $cssRules = fread(fopen($_FILES['css_filename']['tmp_name'], 'r'), $_FILES['css_filename']['size']);
    $cssRules = Check::safeText($cssRules, false);
    //Error::debug($cssRules);
    $_POST['css_file'] = $_FILES['css_filename']['name'];
    $_POST['css_rules'] = $cssRules;
    Form::setSession($_POST);
    header("Location: " . $returnLocation);
    exit;
}
/**
 * Show page
 */
$title = _("Preload CSS file");
$focusFormField = "css_filename";
// to avoid JavaScript mistakes in demo version
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Admin") => "../admin/index.php", _("Themes") => "../admin/theme_list.php", strstr($returnLocation, "edit") ? _("Edit Theme") : _("Add New Theme") => $returnLocation, $title => "");
echo HTML::breadcrumb($links, "icon icon_theme");
    $formVar["surname1"] = $patient->getSurname1();
    $formVar["surname2"] = $patient->getSurname2();
    $formVar["address"] = $patient->getAddress();
    $formVar["phone_contact"] = $patient->getPhone();
    $formVar["sex"] = $patient->getSex();
    $formVar["race"] = $patient->getRace();
    $formVar["birth_date"] = $patient->getBirthDate();
    $formVar["birth_place"] = $patient->getBirthPlace();
    $formVar["decease_date"] = $patient->getDeceaseDate();
    $formVar["nts"] = $patient->getNTS();
    $formVar["nss"] = $patient->getNSS();
    $formVar["family_situation"] = $patient->getFamilySituation();
    $formVar["labour_situation"] = $patient->getLabourSituation();
    $formVar["education"] = $patient->getEducation();
    $formVar["insurance_company"] = $patient->getInsuranceCompany();
    Form::setSession($formVar);
    unset($patient);
} else {
    $patName = $formVar["first_name"] . ' ' . $formVar["surname1"] . ' ' . $formVar["surname2"];
}
/**
 * Show page
 */
$title = _("Edit Patient Social Data");
$titlePage = $patName . ' (' . $title . ')';
$focusFormField = "nif";
// to avoid JavaScript mistakes in demo version
require_once "../layout/header.php";
//$returnLocation = "../medical/patient_view.php?id_patient=" . $idPatient;
$returnLocation = "../medical/patient_view.php";
//Error::debug($formVar);