CAppUI::setMsg("Mot de passe incorrect", UI_MSG_ERROR);
        echo CAppUI::getMsg();
        CApp::rip();
    }
    $object->cloture_activite_1 = 1;
    if ($msg = $object->store()) {
        CAppUI::setMsg($msg, UI_MSG_ERROR);
    } else {
        CAppUI::setMsg("COperation-msg-modify", UI_MSG_OK);
    }
}
if ($password_activite_4) {
    $anesth = new CMediusers();
    $anesth->load($anesth_id);
    if ($anesth->_id) {
        if (!CUser::checkPassword($anesth->_user_username, $password_activite_4)) {
            CAppUI::setMsg("Mot de passe incorrect", UI_MSG_ERROR);
            echo CAppUI::getMsg();
            CApp::rip();
        }
        $object->cloture_activite_4 = 1;
        if ($msg = $object->store()) {
            CAppUI::setMsg($msg, UI_MSG_ERROR);
        } else {
            CAppUI::setMsg("COperation-msg-modify", UI_MSG_OK);
        }
    }
}
// Transmission des actes CCAM
if (CAppUI::conf("dPpmsi transmission_actes") == "signature" && $object instanceof COperation && $object->testCloture()) {
    $object->loadRefs();
Example #2
0
if (!$username) {
    CAppUI::setMsg("Auth-failed-nousername", UI_MSG_ERROR);
} else {
    if ($user->user_type == 1 && (!$ldap_connection || $allow_login_as_ldap)) {
        // If admin: no need to give a password
        $_REQUEST['loginas'] = $username;
        CAppUI::login();
    } else {
        if (!$password) {
            CAppUI::setMsg("Auth-failed-nopassword", UI_MSG_ERROR);
        } else {
            $_REQUEST['loginas'] = $username;
            if (CAppUI::conf("admin LDAP ldap_connection")) {
                $_REQUEST['passwordas'] = $password;
                CAppUI::login(true);
            } else {
                if (!CUser::checkPassword($username, $password)) {
                    CAppUI::setMsg("Auth-failed-combination", UI_MSG_ERROR);
                } else {
                    CAppUI::login(true);
                }
            }
        }
    }
}
if ($msg = CAppUI::getMsg()) {
    echo $msg;
    return;
} else {
    CAppUI::callbackAjax('UserSwitch.reload');
}
Example #3
0
 * @version    $Revision$
 * @link       http://www.mediboard.org
 */
$codable_id = Cvalue::post('codable_id');
$codable_class = CValue::post('codable_class');
$praticien_id = Cvalue::post('praticien_id');
$date = Cvalue::post('date');
$user_password = CValue::post('user_password');
$lock_all_codages = Cvalue::post('lock_all_codages', 0);
$lock = CValue::post('lock', 1);
$codage = new CCodageCCAM();
$codage->praticien_id = $praticien_id;
$codage->codable_class = $codable_class;
$codage->codable_id = $codable_id;
if ($date && !$lock_all_codages) {
    $codage->date = $date;
}
$codages = $codage->loadMatchingList();
$user = CMediusers::get();
if (CAppUI::conf('ccam CCodable lock_codage_ccam') != 'password' || CAppUI::conf('ccam CCodable lock_codage_ccam') == 'password' && $user->_id && CUser::checkPassword($user->_user_username, $user_password)) {
    foreach ($codages as $_codage) {
        $_codage->locked = $lock;
        $_codage->store();
    }
    $msg = $lock ? 'CCodageCCAM-msg-codage_locked' : 'CCodageCCAM-msg-codage_unlocked';
    CAppUI::setMsg($msg, UI_MSG_OK);
    echo CAppUI::getMsg();
} elseif ($user_password && CAppUI::conf('ccam CCodable lock_codage_ccam') == 'password') {
    CAppUI::setMsg("CUser-user_password-nomatch", UI_MSG_ERROR);
    echo CAppUI::getMsg();
}
/**
 * $Id$
 *
 * @category Admin
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$password = trim(CValue::post('password'));
$lock = CValue::post('lock');
if ($lock) {
    $_SESSION['locked'] = true;
    return;
} else {
    if (!$password) {
        CAppUI::setMsg("Auth-failed-nopassword", UI_MSG_ERROR);
    }
    if (!CUser::checkPassword(CUser::get()->user_username, $password)) {
        CAppUI::setMsg("Auth-failed-combination", UI_MSG_ERROR);
    }
    if ($msg = CAppUI::getMsg()) {
        echo $msg;
        return;
    } else {
        CAppUI::callbackAjax('Session.unlock');
        $_SESSION['locked'] = false;
    }
}
Example #5
0
/**
 * $Id: $
 *
 * @category Admin
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 18541 $
 * @link     http://www.mediboard.org
 */
$old_pwd = CValue::post("old_pwd");
$new_pwd1 = CValue::post("new_pwd1");
$new_pwd2 = CValue::post("new_pwd2");
$callback = CValue::post("callback");
// Vérification du mot de passe actuel de l'utilisateur courant
$user = CUser::checkPassword(CUser::get()->user_username, $old_pwd, true);
// Mot de passe actuel correct
if (!$user->_id) {
    CAppUI::stepAjax("CUser-user_password-nomatch", UI_MSG_ERROR);
}
if (!$user->canChangePassword()) {
    CAppUI::stepAjax("CUser-password_change_forbidden", UI_MSG_ERROR);
}
$allow_change_password = CAppUI::conf("admin LDAP allow_change_password");
$ldap_linked = $user->isLDAPLinked();
// Si utilisateur associé au LDAP et modif de mot de passe non autorisée: ERROR
if (!$allow_change_password && $ldap_linked) {
    CAppUI::stepAjax("CUser_associate-ldap-no-password-change", UI_MSG_ERROR);
}
// Mots de passe différents
if ($new_pwd1 != $new_pwd2) {
<?php

/**
 * $Id$
 *  
 * @category CompteRendu
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$user_id = CValue::post("user_id");
$user_password = CValue::post("user_password");
$form_name = CValue::post("form_name");
$callback = CValue::post("callback");
$user = new CUser();
$user->load($user_id);
if ($user->_id && CUser::checkPassword($user->user_username, $user_password)) {
    CAppUI::callbackAjax($callback, $user_id, $form_name);
} else {
    CAppUI::setMsg("CUser-user_password-nomatch", UI_MSG_ERROR);
    echo CAppUI::getMsg();
}
} else {
    $redirectUrl = "m=dPsalleOp&tab=vw_signature_actes&date={$date}";
}
// Chargement du praticien
$praticien = new CMediusers();
$praticien->load($praticien_id);
// Test du password
if (!$password) {
    CAppUI::setMsg("Veuillez saisir votre mot de passe", UI_MSG_ERROR);
    echo CAppUI::getMsg();
    if ($redirectUrl) {
        CAppUI::redirect($redirectUrl);
    }
    CApp::rip();
}
if (!CUser::checkPassword($praticien->_user_username, $password)) {
    CAppUI::setMsg("Mot de passe incorrect", UI_MSG_ERROR);
    echo CAppUI::getMsg();
    if ($redirectUrl) {
        CAppUI::redirect($redirectUrl);
    }
    CApp::rip();
}
// Chargement des actes CCAM à modifier
$acte_ccam = new CActeCCAM();
$acte_ccam->object_id = $object_id;
$acte_ccam->object_class = $object_class;
$acte_ccam->executant_id = $praticien->_id;
$acte_ccam->signe = 0;
/** @var CActeCCAM[] $actes_ccam */
$actes_ccam = $acte_ccam->loadMatchingList();
 /**
  * @see parent::check()
  */
 function check()
 {
     $msg = null;
     $this->completeField("chir_id", "plageop_id", "sejour_id");
     if (!$this->_id && !$this->chir_id) {
         $msg .= "Praticien non valide ";
     }
     // Bornes du séjour
     $sejour = $this->loadRefSejour();
     $this->loadRefPlageOp();
     if ($this->_check_bounds && !$this->_forwardRefMerging) {
         if ($this->plageop_id !== null && !$sejour->entree_reelle) {
             $date = CMbDT::date($this->_datetime);
             $entree = CMbDT::date($sejour->entree_prevue);
             $sortie = CMbDT::date($sejour->sortie_prevue);
             if (!CMbRange::in($date, $entree, $sortie)) {
                 $msg .= "Intervention du {$date} en dehors du séjour du {$entree} au {$sortie}";
             }
         }
     }
     // Vérification de la signature de l'anesthésiste pour la visite de pré-anesthésie
     if ($this->fieldModified("prat_visite_anesth_id") && $this->prat_visite_anesth_id !== null && $this->prat_visite_anesth_id != CAppUI::$user->_id) {
         $anesth = new CUser();
         $anesth->load($this->prat_visite_anesth_id);
         if (!CUser::checkPassword($anesth->user_username, $this->_password_visite_anesth)) {
             $msg .= "Mot de passe incorrect";
         }
     }
     return $msg . parent::check();
 }
 /**
  * @see parent::store()
  */
 function store()
 {
     if ($this->validator_id) {
         // Verification du mot de passe
         if ($this->_validator_password) {
             $this->loadRefsFwd();
             if (!CUser::checkPassword($this->_ref_validator->_user_username, $this->_validator_password)) {
                 $this->validator_id = "";
                 return 'Le mot de passe entré n\'est pas correct';
             }
         }
         // Validator_id passé mais il ne faut pas l'enregistré
         /** @var self $old */
         $old = $this->loadOldObject();
         if (!$this->_validator_password && !$old->validator_id) {
             $this->validator_id = "";
         }
     }
     if ($this->validator_id && ($this->fieldModified("validator_id") || !$this->_id) && !$this->date_validate) {
         $this->date_validate = CMbDT::dateTime();
     }
     if ($msg = parent::store()) {
         return $msg;
     }
     // Sauvegarde des items cochés
     $items = $this->_items ? $this->_items : array();
     $types = $this->loadItemTypes();
     if (!empty($items)) {
         foreach ($types as $type) {
             $check_item = new CDailyCheckItem();
             $check_item->list_id = $this->_id;
             $check_item->item_type_id = $type->_id;
             $check_item->loadMatchingObject();
             $check_item->checked = isset($items[$type->_id]) ? $items[$type->_id] : "";
             $check_item->store();
             // Don't return if the item was not present
         }
     }
     return null;
 }