Go to the documentation of this file.
28 include_once DOL_DOCUMENT_ROOT.
'/core/class/openid.class.php';
42 global $db, $conf, $langs;
44 dol_syslog(
"functions_openid::check_user_password_openid usertotest=".$usertotest);
51 $openid->SetIdentity(
GETPOST(
'username'));
52 $protocol = ($conf->file->main_force_https ?
'https://' :
'http://');
53 $openid->SetTrustRoot($protocol.$_SERVER[
"HTTP_HOST"]);
54 $openid->SetRequiredFields(array(
'email',
'fullname'));
55 $_SESSION[
'dol_entity'] =
GETPOST(
"entity",
'int');
57 if ($openid->sendDiscoveryRequestToGetXRDS()) {
58 $openid->SetApprovedURL($protocol.$_SERVER[
"HTTP_HOST"].$_SERVER[
"SCRIPT_NAME"]);
61 $_SESSION[
"dol_loginmesg"] = $openid->GetError();
65 } elseif ($_GET[
'openid_mode'] ==
'id_res') {
68 $openid->SetIdentity(
GETPOST(
'openid_identity'));
69 $openid_validation_result = $openid->ValidateWithServer();
70 if ($openid_validation_result ===
true) {
73 $sql =
"SELECT login, entity, datestartvalidity, dateendvalidity";
74 $sql .=
" FROM ".MAIN_DB_PREFIX.
"user";
75 $sql .=
" WHERE openid = '".$db->escape(
GETPOST(
'openid_identity')).
"'";
76 $sql .=
" AND entity IN (0,".(!empty($_SESSION[
"dol_entity"]) ? ((int) $_SESSION[
"dol_entity"]) : 1).
")";
78 dol_syslog(
"functions_openid::check_user_password_openid", LOG_DEBUG);
79 $resql = $db->query(
$sql);
81 $obj = $db->fetch_object($resql);
100 } elseif ($openid->IsError() ===
true) {
102 $_SESSION[
"dol_loginmesg"] = $openid->GetError();
109 } elseif ($_GET[
'openid_mode'] ==
'cancel') {
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
check_user_password_openid($usertotest, $passwordtotest, $entitytotest)
Check validity of user/password/entity If test is ko, reason must be filled into $_SESSION["dol_login...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.