AUTHORIZE_USER_LOGIN User $SQL_USER Adm_Account=$ADM_ACCOUNT mysql_pconnect($INTERFACE_ADDR,$SQL_USER,$SQL_USER_PASS);"; $NIP = ''; $REQ = $AUTH_API."?user=".$ADM_ACCOUNT."&pass=".urlencode($ADM_PASSWD)."&request=auth";//&request_module=sew"; DEBUG_S(4, 'AUTH_API', $REQ); try { $tresc = file_get_contents($REQ); } catch (Exception $e) { DEBUG_S(3, "AUTH_API error", $e->getMessage()); echo'AUTH_API error'; return; } if ($tresc !== FALSE) { $tresc = str_replace(array("\n","\r"),"",$tresc);// remove ne lines for preg_match_all if (strpos($tresc,'') !== FALSE) { if (preg_match_all("/(.*?)<\/error>/", $tresc, $matches, PREG_SET_ORDER)) { $ERROR = $matches[0][0]; } } else if (strpos($tresc,'') !== FALSE && strpos($tresc,'') !== FALSE) { if (preg_match_all("/(.*?)<\/auth>/", $tresc, $matches, PREG_SET_ORDER)) { $AUTH = $matches[0][0]; $tags="nip"; if (preg_match_all("/(.*?)<\/nip>/", $AUTH, $matches, PREG_SET_ORDER)) { $match = $matches[0][0]; $match=str_replace("<".$tags.">", "", $match); $match=str_replace("", "", $match); $_SESSION['AUTHORIZE_USER_LOGIN_BY_AUTH_MODULE']['P_NIP']=$match; } $tags="status"; if (preg_match_all("/(.*?)<\/status>/", $tresc, $matches, PREG_SET_ORDER)) { $match=$matches[0][0]; $match=str_replace("<".$tags.">", "", $match); $match=str_replace("", "", $match); $_SESSION['AUTHORIZE_USER_LOGIN_BY_AUTH_MODULE']['status'] = $match; } $tags="DUTIES_GID"; if (preg_match_all("/(.*?)<\/DUTIES_GID>/", $tresc, $matches, PREG_SET_ORDER)) { $match=$matches[0][0]; $match=str_replace("<".$tags.">", "", $match); $match=str_replace("", "", $match); $_SESSION['AUTHORIZE_USER_LOGIN_BY_AUTH_MODULE']['DUTIES_GID'] = $match; $_SESSION['DUTIES_GID']=$match; } } } else { $ERROR = "Bᄈᄆd konwersji"; } } else { DEBUG_S(3, "LOGOWANIE", $AUTH_API); echo "

Wystᄆpiᄈy bᄈ↑dy podczas poᄈᄆczenia do zewn↑trznego moduᄈu

"; } //if(isset($_SESSION['AUTHORIZE_USER_LOGIN_BY_AUTH_MODULE']['status'])) if ($_SESSION['AUTHORIZE_USER_LOGIN_BY_AUTH_MODULE']['status'] == 'OK') { $_SESSION['ADM_PASSWD']="$ADM_PASSWD"; $_SESSION['AUTHORIZE_USER']="$ADM_ACCOUNT";//TODO: read from XML $_SESSION['ADM_ACCOUNT']="$ADM_ACCOUNT"; $_SESSION['ADM_AREA']=""; $_SESSION['ADM_NAME']=""; $_SESSION['ADM_TECH_WORKER']=""; $_SESSION['ADM_COMPANY']=""; $_SESSION['ADM_ADMIN_LEVEL']=""; $_SESSION['ADM_PHONE']=""; $_SESSION['ADM_ADMIN_EXPIRE']=""; echo "

Nastᄆpiᄈo poprawne logowanie do zewn↑trznego moduᄈu autoryzacji


Informacje: ".$AUTH.""; return; } else { echo "

Wystᄆpiᄈy bᄈ↑dy w logowaniu z zewn↑trznego moduᄈu


".$ERROR.""; } SEF("DEBUG_S"); DEBUG_S(3, "STATUS", $_SESSION['AUTHORIZE_USER_LOGIN_BY_AUTH_MODULE']['status']); DEBUG_S(3, "NIP", $NIP); DEBUG_S(3, "ADM_NAME", $_SESSION['ADM_NAME']); DEBUG_S(3, "DUTIES_GID", $_SESSION['DUTIES_GID']); } ?>