From f51c9ed2abe5c68211bb3736be5f70b1fe2c9ec0 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 8 Mar 2019 21:20:34 +0100 Subject: további rendrakás --- .../www/policy/private/session/accountInfo-pre.php | 75 ------------- .../www/policy/private/session/accountInfo.php | 19 ---- .../private/session/admin/knownNodes-pre.php | 39 ------- .../policy/private/session/admin/knownNodes.php | 10 -- .../private/session/admin/registration-pre.php | 123 --------------------- .../policy/private/session/admin/registration.php | 16 --- .../policy/private/session/createAccount-pre.php | 110 ------------------ .../www/policy/private/session/createAccount.php | 12 -- .../www/policy/private/session/createGroup-pre.php | 49 -------- .../www/policy/private/session/createGroup.php | 12 -- .../www/policy/private/session/download-pre.php | 66 ----------- mayor-orig/www/policy/private/session/download.php | 9 -- .../www/policy/private/session/eduroam-pre.php | 5 - mayor-orig/www/policy/private/session/eduroam.php | 0 .../policy/private/session/facebookConnect-pre.php | 91 --------------- .../www/policy/private/session/facebookConnect.php | 7 -- .../www/policy/private/session/googleapi-pre.php | 100 ----------------- .../www/policy/private/session/googleapi.php | 28 ----- .../www/policy/private/session/groupInfo-pre.php | 43 ------- .../www/policy/private/session/groupInfo.php | 12 -- .../private/session/search/searchAccount-pre.php | 29 ----- .../private/session/search/searchAccount.php | 16 --- .../private/session/search/searchGroup-pre.php | 25 ----- .../policy/private/session/search/searchGroup.php | 16 --- .../www/policy/private/session/session-pre.php | 5 - mayor-orig/www/policy/private/session/session.php | 0 .../policy/private/session/sessionAdmin-pre.php | 24 ---- .../www/policy/private/session/sessionAdmin.php | 9 -- 28 files changed, 950 deletions(-) delete mode 100644 mayor-orig/www/policy/private/session/accountInfo-pre.php delete mode 100644 mayor-orig/www/policy/private/session/accountInfo.php delete mode 100644 mayor-orig/www/policy/private/session/admin/knownNodes-pre.php delete mode 100644 mayor-orig/www/policy/private/session/admin/knownNodes.php delete mode 100644 mayor-orig/www/policy/private/session/admin/registration-pre.php delete mode 100644 mayor-orig/www/policy/private/session/admin/registration.php delete mode 100644 mayor-orig/www/policy/private/session/createAccount-pre.php delete mode 100644 mayor-orig/www/policy/private/session/createAccount.php delete mode 100644 mayor-orig/www/policy/private/session/createGroup-pre.php delete mode 100644 mayor-orig/www/policy/private/session/createGroup.php delete mode 100644 mayor-orig/www/policy/private/session/download-pre.php delete mode 100644 mayor-orig/www/policy/private/session/download.php delete mode 100644 mayor-orig/www/policy/private/session/eduroam-pre.php delete mode 100644 mayor-orig/www/policy/private/session/eduroam.php delete mode 100644 mayor-orig/www/policy/private/session/facebookConnect-pre.php delete mode 100644 mayor-orig/www/policy/private/session/facebookConnect.php delete mode 100644 mayor-orig/www/policy/private/session/googleapi-pre.php delete mode 100644 mayor-orig/www/policy/private/session/googleapi.php delete mode 100644 mayor-orig/www/policy/private/session/groupInfo-pre.php delete mode 100644 mayor-orig/www/policy/private/session/groupInfo.php delete mode 100644 mayor-orig/www/policy/private/session/search/searchAccount-pre.php delete mode 100644 mayor-orig/www/policy/private/session/search/searchAccount.php delete mode 100644 mayor-orig/www/policy/private/session/search/searchGroup-pre.php delete mode 100644 mayor-orig/www/policy/private/session/search/searchGroup.php delete mode 100644 mayor-orig/www/policy/private/session/session-pre.php delete mode 100644 mayor-orig/www/policy/private/session/session.php delete mode 100644 mayor-orig/www/policy/private/session/sessionAdmin-pre.php delete mode 100644 mayor-orig/www/policy/private/session/sessionAdmin.php (limited to 'mayor-orig/www/policy/private/session') diff --git a/mayor-orig/www/policy/private/session/accountInfo-pre.php b/mayor-orig/www/policy/private/session/accountInfo-pre.php deleted file mode 100644 index 9b54adf5..00000000 --- a/mayor-orig/www/policy/private/session/accountInfo-pre.php +++ /dev/null @@ -1,75 +0,0 @@ -$changeSkinTo)); - - } elseif ($action=='generateEduroamId') { - $eduroamDOMAIN = readVariable($_POST['eduroamDOMAIN'],'enum',null,$eduroamDOMAINS); - $eduroamPASSWORD = @exec('pwgen'); - if (__TANAR===true) { - $eduroamAFFILIATION = 'faculty'; - } elseif (__DIAK===true) { - $eduroamAFFILIATION = 'student'; - } else { - $eduroamAFFILIATION = 'staff'; - } - createEduroamSettings(array('userAccount'=>$userAccount,'policy'=> $toPolicy, - 'eduroamUID' => $userAccount, - 'eduroamDOMAIN'=>$eduroamDOMAIN, - 'eduroamAFFILIATION'=>$eduroamAFFILIATION, - 'eduroamPASSWORD'=>$eduroamPASSWORD)); - } elseif ($action=='modoifyEduroamId') { - - } - - $userInfo = getUserInfo($userAccount, $toPolicy); // keretrendszer attribútumai - $accountInfo = getAccountInfo($userAccount, $toPolicy); // backend attribútumai - - $ADAT = getUserSettings($userAccount, $toPolicy); - $ADAT['activity'] = getMyActivity(); - - if ($toPolicy=='private' && _POLICY ==='private') { - $ADAT['eduroamAdat'] = getEduroamSettings($userAccount, $toPolicy); - // dump($ADAT); - } -?> diff --git a/mayor-orig/www/policy/private/session/accountInfo.php b/mayor-orig/www/policy/private/session/accountInfo.php deleted file mode 100644 index 66642ef3..00000000 --- a/mayor-orig/www/policy/private/session/accountInfo.php +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/admin/knownNodes-pre.php b/mayor-orig/www/policy/private/session/admin/knownNodes-pre.php deleted file mode 100644 index d166babd..00000000 --- a/mayor-orig/www/policy/private/session/admin/knownNodes-pre.php +++ /dev/null @@ -1,39 +0,0 @@ -getPublicKey(); - $ADAT['my']['nodeId'] = $RPC->getNodeId(); - - - if ($action == 'rpcPing') { - $ADAT['nodeId'] = readVariable($_POST['nodeId'],'id'); - $RPC->setRemoteHostByNodeId($ADAT['nodeId']); - $RPC->setRequestTarget('base'); - $ADAT['pingResult'] = $RPC->sendRequest(array('func'=>'ping')); - $ADAT['nodeVersion'] = $ADAT['pingResult']['revision']; - // $RPC->setRequestTarget('controller'); - } elseif ($action == 'getPublicDataByNodeId') { - $ADAT['nodeId'] = readVariable($_POST['nodeId'],'id'); - $RPC->setRequestTarget('base'); - $RPC->setRemoteHostByNodeId($ADAT['nodeId']); - } elseif ($action == 'removeNode') { - $ADAT['nodeId'] = readVariable($_POST['nodeId'],'id'); - removeNodeFromLocalKeychain($ADAT['nodeId']); - } - - $ADAT['nodes'] = getPublicDataFromLocalKeychain(); - - } - -?> diff --git a/mayor-orig/www/policy/private/session/admin/knownNodes.php b/mayor-orig/www/policy/private/session/admin/knownNodes.php deleted file mode 100644 index e7a95d58..00000000 --- a/mayor-orig/www/policy/private/session/admin/knownNodes.php +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/admin/registration-pre.php b/mayor-orig/www/policy/private/session/admin/registration-pre.php deleted file mode 100644 index eabc8cfe..00000000 --- a/mayor-orig/www/policy/private/session/admin/registration-pre.php +++ /dev/null @@ -1,123 +0,0 @@ - array('kotelezo'=>true,'options'=>$ADAT['NODETIPUSOK']), - 'nev' => array('kotelezo'=>true), - 'rovidNev' => array(), - 'OMKod' => array(), - 'cimHelyseg' => array('kotelezo'=>true), - 'cimIrsz' => array('kotelezo'=>true), - 'cimKozteruletNev' => array('kotelezo'=>true), - 'cimKozteruletJelleg' => array('kotelezo'=>true), - 'cimHazszam' => array('kotelezo'=>true), - 'telefon' => array(), - 'fax' => array(), - 'email' => array(), - 'honlap' => array(), - 'url' => array(), - 'kapcsolatNev' => array('kotelezo'=>true), - 'kapcsolatEmail' => array('kotelezo'=>true), - 'kapcsolatTelefon' => array(), - // külön, más helyen jelennek meg - 'dij'=> array('kotelezo'=>true,'display'=>false,'type'=>'none'), - 'egyebTamogatas' => array('display'=>false,'type'=>'none'), - 'utemezes'=>array('display'=>false,'type'=>'none'), - // rejtett mezők - nem módosíthatók - 'regId'=>array('display'=>false,'type'=>'none'), - 'dt'=>array('display'=>false), - 'publicKey' => array('kotelezo'=>true,'display'=>false,'readonly'=>true,'type'=>'textarea'), - ); - $ADAT['my']['url'] = $url = substr($_SERVER["HTTP_REFERER"], 0, strpos($_SERVER["HTTP_REFERER"], 'index.php?')); - $ADAT['my']['dt'] = date('Y-m-d'); - - $RPC = new Interconnect(); - $ADAT['my']['publicKey'] = $RPC->getPublicKey(); - $ADAT['my']['nodeId'] = $RPC->getNodeId(); - - // regisztráció - if ($action == 'sendRegRequest') { - unset($_POST['action']); - $_POST['publicRequest'] = 'registration'; - $res = json_decode(sendPublicRequest($_POST), true); - foreach ($res['alert'] as $index => $aAdat) $_SESSION['alert'][] = implode(':',$aAdat); - if ($res['success'] === true) { - setNodeId($res['nodeId'], $ADAT['my']['publicKey']); - $ADAT['my']['nodeId'] = $res['nodeId']; - $RPC = new Interconnect(); // újracsatlakozás... - } - //dump($res); - } elseif ($action == 'checkOldRegByPublicKey') { - $DATA['publicKey'] = $ADAT['my']['publicKey']; - $DATA['publicRequest'] = 'getNodeIdByPublicKey'; - // ha kellene ellenőrzés, akkar a választ a publicKey-el kódolva kellene küldeni... - $res = json_decode(sendPublicRequest($DATA), true); - foreach ($res['alert'] as $index => $aAdat) $_SESSION['alert'][] = implode(':',$aAdat); - if ($res['success'] === true) { - setNodeId($res['nodeId'], $ADAT['my']['publicKey']); - $ADAT['my']['nodeId'] = $res['nodeId']; - $RPC = new Interconnect(); // újracsatlakozás... - } - dump($res); - } - - if ($ADAT['my']['nodeId'] != 0) - try { - $RPC->setRemoteHostByNodeId(''); // controller - $RPC->setRequestTarget('controller'); - $ADAT['registrationStatus']['result'] = $RPC->sendRequest(array('func'=>'checkRegistration')); - //dump($ADAT['registrationStatus']['result'], $RPC->getStatus()); - // Teszt: egy alap metódus lekérdezése... - //$RPC->setRequestTarget('base'); - // $ADAT['controllerVersion'] = $RPC->sendRequest(array('func'=>'ping')); - // dump($ADAT['controllerVersion']); - // $RPC->setRequestTarget('controller'); - if ($ADAT['registrationStatus']['result']['valid'] == 1) { - $ADAT['regAdat'] = $RPC->getRegistrationDataByNodeId($ADAT['my']['nodeId']); - //dump($ADAT['regAdat'], $RPC->getStatus()); - } - } catch (Exception $e) { - dump("checkRegistration",$e); - } - - if ($action == 'modRegAdat') { - $MOD = array(); - foreach ($ADAT['regAdat']['nodeData'] as $key => $value) { - $newValue = readVariable($_POST[$key], 'string'); - if ( - !in_array($key, array('nodeId','regId','publicKey')) - && str_replace(array("\n","\r","\n\r"),"",$value) != str_replace(array("\n","\r","\n\r"),"",$newValue) - && !is_null($newValue) - ) $MOD[$key] = $newValue; - } - if (count($MOD) > 0) try { - // Interconnect-en keresztül!! - $ADAT['modRegData']['result'] = $RPC->sendRequest( - array('func'=>'modRegData', 'data'=>$MOD, 'regId'=>$ADAT['regAdat']['nodeData']['regId']) - ); - // A megjelenítéshez módosítjuk a kirakandó adatokat helyben is. - if ($ADAT['modRegData']['result']['result'] === true) { - $_SESSION['alert'][] = 'info:success:A regisztrációs adatokat módosítottuk a regisztrációs szerveren.'; - foreach ($MOD as $key => $val) $ADAT['regAdat']['nodeData'][$key] = $val; - } else { - $_SESSION['alert'][] = 'message:wrong_data:Az adatmódosítás nem sikerült a regisztrációs szerveren.'; - } - } catch (Exception $e) { - dump("modRegData",$e); - } - - } - - } - -?> diff --git a/mayor-orig/www/policy/private/session/admin/registration.php b/mayor-orig/www/policy/private/session/admin/registration.php deleted file mode 100644 index 6ad2d8e7..00000000 --- a/mayor-orig/www/policy/private/session/admin/registration.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/createAccount-pre.php b/mayor-orig/www/policy/private/session/createAccount-pre.php deleted file mode 100644 index ce789482..00000000 --- a/mayor-orig/www/policy/private/session/createAccount-pre.php +++ /dev/null @@ -1,110 +0,0 @@ - byAdmin esetén csak az érintet policy-n belül az adminGroup tagjainak lehet létrehozni új account-ot - createAccount => byRegistration esetén bárki regisztrálhat bármely policy-ből -*/ - - if (_RIGHTS_OK !== true) die(); - - if (memberOf(_USERACCOUNT, $AUTH[_POLICY]['adminGroup'])) { - $DEFAULTS['userAccount'] = readVariable($_GET['userAccount'],'userAccount'); - $DEFAULTS['userCn'] = readVariable($_GET['userCn'],'emptystringnull'); - $DEFAULTS['userPassword'] = readVariable($_GET['userPassword'],'emptystringnull'); - $DEFAULTS['mail'] = readVariable($_GET['email'],'emptystringnull'); - $DEFAULTS['telephoneNumber'] = readVariable($_GET['tel'],'emptystringnull'); - } - - $toPolicy = readVariable($_POST['toPolicy'], 'enum', readVariable($_GET['toPolicy'], 'enum',_POLICY, $POLICIES), $POLICIES); - - @$toPSF = $_REQUEST['toPSF']; - - if ($toPolicy != _POLICY) require_once(_CONFIGDIR."/$toPolicy-conf.php"); - if ( - ( - $AUTH[$toPolicy]['createAccount'] == 'byAdmin' - and memberOf(_USERACCOUNT, $AUTH['private']['adminGroup']) - ) - or ( - $AUTH[$toPolicy]['createAccount'] == 'byRegistration' - && _USERACCOUNT =='' - ) - ) { - define('_ENABLE',true); - } else { - define('_ENABLE',false); - $_SESSION['alert'][] = 'page:insufficient_access:#1'; - } - - if (_ENABLE && $action == 'createAccount' && isset($_POST['new'])) { - - $file = $_FILES['file']['tmp_name']; - if ($file != '' && $file != 'none' && file_exists($file)) { - - $uidfp=fopen($file, 'r'); - while ($sor=fgets($uidfp, 4096)) { - list($userCn, $userAccount, $userPassword, $category, $studyId, $container)=explode(" ",chop($sor)); - // A biztonság kedvéért ez a html form validációval egyező legyen - $userCn = readVariable($userCn,'html'); - $userAccount = readvariable($userAccount,'html'); - $studyId = readVariable($studyId,'number'); - $category = readVariable($category, 'enum','',$AUTH[$toPolicy]['categories']); - $container = readVariable($container,'enum','',$AUTH[$toPolicy][$AUTH[$toPolicy]['backend'].'Containers']); - $policyAccountAttrs = array(); - if (is_array($AUTH[$toPolicy]['accountAttrs'])) foreach ($AUTH[$toPolicy]['accountAttrs'] as $attr) { - if (isset($$attr) and $$attr != '') $policyAccountAttrs[$attr] = readVariable($$attr, 'string'); - } - if (createAccount($userCn, $userAccount, $userPassword, $toPolicy, array('container'=> $container, 'category' => $category, 'policyAttrs' => $policyAccountAttrs)) ===false) { - $_SESSION['alert'][] = "info:user_create_failure: cn.$userCn|account.$userAccount|policy.$toPolicy|category.$category|container.$container"; - } - } - fclose($uidfp); - - } else { - - // kötelező paraméterek - $userCn = readVariable($_POST['userCn'],'html'); - $userAccount = readvariable($_POST['userAccount'],'html'); - $studyId = readVariable($_POST['studyId'],'number'); - $userPassword = $_POST['userPassword']; - $verification = $_POST['verification']; - - // opcionális paraméterek - $category = readVariable($_POST['category'], 'enum','',$AUTH[$toPolicy]['categories']); - $container = readVariable($_POST['container'],'enum','',$AUTH[$toPolicy][$AUTH[$toPolicy]['backend'].'Containers']); - - $policyAccountAttrs = array(); - if (is_array($AUTH[$toPolicy]['accountAttrs'])) foreach ($AUTH[$toPolicy]['accountAttrs'] as $attr) { - if (isset($_POST[$attr]) and $_POST[$attr] != '') $policyAccountAttrs[$attr] = readVariable($_POST[$attr], 'string'); // ??? - } - - if ($userCn == '' or $userAccount == '' or $userPassword == '' or $verification == '') { - // Csak policy váltás történt - // $_SESSION['alert'][] = 'message:empty_field'; - } elseif ($userPassword != $verification) { - $_SESSION['alert'][] = 'message:pw_not_match'; - } else { - if (createAccount($userCn, $userAccount, $userPassword, $toPolicy, - array('container'=> $container, 'category' => $category, 'policyAttrs' => $policyAccountAttrs))) { - if ( - _POLICY == 'private' - && memberOf(_USERACCOUNT, $AUTH[_POLICY]['adminGroup']) - ) header('Location: '.location("index.php?page=session&f=accountInfo&userAccount=$userAccount&toPolicy=$toPolicy")); - elseif (_POLICY == 'public') { - $toPSF = ($toPSF=='') ? 'auth::login' : $toPSF; - header( - 'Location: '.location("index.php?page=auth&f=login&userAccount=$userAccount&policy=public&toPolicy=$toPolicy&toPSF=$toPSF", array('skin','lang','sessionID')) - ); - } else { - $toPSF = ($toPSF=='') ? 'session::accountInfo' : $toPSF; - header( - 'Location: '.location("index.php?page=auth&f=login&userAccount=$userAccount&policy=public&toPolicy=$toPolicy&toPSF=$toPSF", array('skin','lang','sessionID')) - ); - } - } - } - } - - } - -?> diff --git a/mayor-orig/www/policy/private/session/createAccount.php b/mayor-orig/www/policy/private/session/createAccount.php deleted file mode 100644 index 94c4b703..00000000 --- a/mayor-orig/www/policy/private/session/createAccount.php +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/createGroup-pre.php b/mayor-orig/www/policy/private/session/createGroup-pre.php deleted file mode 100644 index 8b65ce02..00000000 --- a/mayor-orig/www/policy/private/session/createGroup-pre.php +++ /dev/null @@ -1,49 +0,0 @@ - $container, 'policyAttrs' => $policyGroupAttrs))) { - header('Location: '.location("index.php?page=session&f=groupInfo&groupCn=$groupCn&toPolicy=$toPolicy")); - } - } - } - - - } - -?> diff --git a/mayor-orig/www/policy/private/session/createGroup.php b/mayor-orig/www/policy/private/session/createGroup.php deleted file mode 100644 index a914ceaf..00000000 --- a/mayor-orig/www/policy/private/session/createGroup.php +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/download-pre.php b/mayor-orig/www/policy/private/session/download-pre.php deleted file mode 100644 index 6b396143..00000000 --- a/mayor-orig/www/policy/private/session/download-pre.php +++ /dev/null @@ -1,66 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/download.php b/mayor-orig/www/policy/private/session/download.php deleted file mode 100644 index 12d907a9..00000000 --- a/mayor-orig/www/policy/private/session/download.php +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/eduroam-pre.php b/mayor-orig/www/policy/private/session/eduroam-pre.php deleted file mode 100644 index 40a406cd..00000000 --- a/mayor-orig/www/policy/private/session/eduroam-pre.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/mayor-orig/www/policy/private/session/eduroam.php b/mayor-orig/www/policy/private/session/eduroam.php deleted file mode 100644 index e69de29b..00000000 diff --git a/mayor-orig/www/policy/private/session/facebookConnect-pre.php b/mayor-orig/www/policy/private/session/facebookConnect-pre.php deleted file mode 100644 index b0988ae5..00000000 --- a/mayor-orig/www/policy/private/session/facebookConnect-pre.php +++ /dev/null @@ -1,91 +0,0 @@ - __FB_APP_ID, - 'app_secret' => __FB_APP_SECRET, - 'cookie' => true, - 'status' => true, - 'default_graph_version' => 'v2.5', - )); - $oAuth2Client = $fb->getOAuth2Client(); - - $helper = $fb->getJavaScriptHelper(); - try { - $accessToken = $helper->getAccessToken(); - // convert - if ($accessToken !='' && !$accessToken->isLongLived()) { - try { - $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); - } catch (Facebook\Exceptions\FacebookSDKException $e) { - $_SESSION['alert'][] = "info::Error getting long-lived access token: " . $helper->getMessage() . ""; - } - } - } catch(Facebook\Exceptions\FacebookResponseException $e) { - // When Graph returns an error - $_SESSION['alert'][] = 'info::Graph returned an error: ' . $e->getMessage(); - } catch(Facebook\Exceptions\FacebookSDKException $e) { - // When validation fails or other local issues - $_SESSION['alert'][] = 'info::Facebook SDK returned an error: ' . $e->getMessage(); - } - if (isset($accessToken)) { - $_SESSION['facebook_access_token'] = (string) $accessToken; - $_SESSION['facebook_access_token_object'] = $accessToken; - $response = $fb->get('/me?fields=id,name,email',$accessToken); - $userNode = $response->getGraphUser(); - $ADAT['fbUserId'] = $userNode->getField('id'); - $ADAT['fbUserCn'] = $userNode->getField('name'); - $ADAT['fbUserEmail'] = $userNode->getField('email'); - } - } - if ($action=='revokeFbAuth') { - fbConnectRevoke($ADAT['fbUserId']); - } elseif ($action=='grantFbAuth') { - fbConnectGrant($ADAT); - } - - $ADAT['fbUserIdStatusz'] = checkFbConnectAssoc($ADAT); - - function checkFbConnectAssoc($ADAT) { - if ($ADAT['fbUserId']=='') return 0; - - $q = "SELECT count(*) AS db FROM facebookConnect where userAccount='%s' AND policy='%s' AND fbUserId='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'fbUserId'=>$ADAT['fbUserId']); - $db = db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','result'=>'value','values'=>$v)); - if ($db==1) return 1; // 'OK'; - - $q = "SELECT count(*) AS db FROM facebookConnect where userAccount='%s' AND policy='%s' AND fbUserId!='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'fbUserId'=>$ADAT['fbUserId']); - $db = db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','result'=>'value','values'=>$v)); - if ($db==1) return 2; // 'masik fbUserId van megadva'; - - $q = "SELECT count(*) AS db FROM facebookConnect where userAccount!='%s' AND policy='%s' AND fbUserId='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'fbUserId'=>$ADAT['fbUserId']); - $db = db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','result'=>'value','values'=>$v)); - if ($db==1) return 3; // 'masik userAccount van hozzárendelve ehhez a fb azonosítóhoz'; - - return false; - } - - function fbConnectRevoke($fbUserId) { - if ($fbUserId=='') return 0; - - $q = "DELETE FROM facebookConnect where userAccount='%s' AND policy='%s' AND fbUserId='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'fbUserId'=>$fbUserId); - return db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','values'=>$v)); - } - function fbConnectGrant($ADAT) { - if ($ADAT['fbUserId']=='') return 0; - - $q = "INSERT IGNORE INTO facebookConnect (userAccount,policy,fbUserId,fbUserCn,fbUserEmail,studyId) VALUES ('%s','%s','%s','%s','%s','%s')"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'fbUserId'=>$ADAT['fbUserId'],'fbUserCn'=>_USERCN.' ('.$ADAT['fbUserCn'].')','fbUserEmail'=>$ADAT['fbUserEmail'],'studyId'=>_STUDYID); - return db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','result'=>'insert','values'=>$v)); - } - -?> \ No newline at end of file diff --git a/mayor-orig/www/policy/private/session/facebookConnect.php b/mayor-orig/www/policy/private/session/facebookConnect.php deleted file mode 100644 index e125c680..00000000 --- a/mayor-orig/www/policy/private/session/facebookConnect.php +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/mayor-orig/www/policy/private/session/googleapi-pre.php b/mayor-orig/www/policy/private/session/googleapi-pre.php deleted file mode 100644 index 49438dcc..00000000 --- a/mayor-orig/www/policy/private/session/googleapi-pre.php +++ /dev/null @@ -1,100 +0,0 @@ -setClientId(__GOOGLEAPI_CLIENT_ID); - $client->setClientSecret(__GOOGLEAPI_CLIENT_SECRET); - $client->setScopes('email'); - // $client->setAccessToken($_SESSION['googleapi_id_token']); - try { - $ADAT['payload'] = $payload = $client->verifyIdToken($_SESSION['googleapi_id_token']); - $ADAT['googleapiStatusz'] = 1; - } catch(Exception $e) { - $_SESSION['alert'][] = 'info::googleapi SDK hiba: ' . $e->getMessage(); - $ADAT['googleapiStatusz'] = 2; - } - } elseif ($_GET['id_token']!='') { - $redirect_uri = _BASE_URL.'/index.php'; - $client = new Google_Client(); - //$client->setAuthConfig($oauth_credentials); - $client->setClientId(__GOOGLEAPI_CLIENT_ID); - $client->setClientSecret(__GOOGLEAPI_CLIENT_SECRET); -// $client->setRedirectUri($redirect_uri); - $client->setScopes('email'); - try { - $payload = $client->verifyIdToken($_GET['id_token']); - } catch(Exception $e) { - $_SESSION['alert'][] = 'info::googleapi SDK hiba: ' . $e->getMessage(); - } - if (isset($payload['sub'])) { // subject - $_SESSION['google_access_token'] = (string) $payload; - $_SESSION['google_access_token_object'] = $payload; - // mayor auth start - $accountInformation=array(); - $toPolicy = 'public'; - $ADAT['googleSub'] = $payload['sub']; -// $ADAT['fbUserId'] = $userNode->getField('id'); - $ADAT['googleUserCn'] = $payload['name']; - $ADAT['googleUserEmail'] = $payload['email']; - googleapiGrant($ADAT); - /* mayor auth stop */ - } else { - $_SESSION['alert'][] = 'info:nem érvényes accessToken'; - } - } - - } - function googleapiCheckAssoc($ADAT) { - if ($ADAT['googleSub']=='') return 0; - - $q = "SELECT count(*) AS db FROM googleConnect where userAccount='%s' AND policy='%s' AND googleSub='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'fbUserId'=>$ADAT['googleSub']); - $db = db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','result'=>'value','values'=>$v)); - if ($db==1) return 1; // 'OK'; - - $q = "SELECT count(*) AS db FROM googleConnect where userAccount='%s' AND policy='%s' AND googleSub!='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'fbUserId'=>$ADAT['googleSub']); - $db = db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','result'=>'value','values'=>$v)); - if ($db==1) return 2; // 'masik googleSub van megadva'; - - $q = "SELECT count(*) AS db FROM googleConnect where userAccount!='%s' AND policy='%s' AND googleSub='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'googleSub'=>$ADAT['googleSub']); - $db = db_query($q,array('fv'=>'facebookConnectCheck','modul'=>'login','result'=>'value','values'=>$v)); - if ($db==1) return 3; // 'masik userAccount van hozzárendelve ehhez a googleSub azonosítóhoz'; - - return false; - } - - function googleapiRevoke() { - $q = "DELETE FROM googleConnect where userAccount='%s' AND policy='%s'"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY); - return db_query($q,array('fv'=>'googleapiRevoke','modul'=>'login','values'=>$v)); - } - function googleapiGrant($ADAT) { - if ($ADAT['googleSub']=='') return 0; - $q = "INSERT IGNORE INTO googleConnect (userAccount,policy,googleSub,googleUserCn,googleUserEmail,studyId) VALUES ('%s','%s','%s','%s','%s','%s')"; - $v = array('userAccount'=>_USERACCOUNT,'policy'=>_POLICY,'googleSub'=>$ADAT['googleSub'],_USERACCOUNT.' ('.$ADAT['googleUserCn'].')',$ADAT['googleUserEmail'],_STUDYID); - return db_query($q,array('debug'=>true,'fv'=>'googleapiGrant','modul'=>'login','result'=>'insert','values'=>$v)); - } - -?> \ No newline at end of file diff --git a/mayor-orig/www/policy/private/session/googleapi.php b/mayor-orig/www/policy/private/session/googleapi.php deleted file mode 100644 index fe079bed..00000000 --- a/mayor-orig/www/policy/private/session/googleapi.php +++ /dev/null @@ -1,28 +0,0 @@ -'; - -// echo '

Tesztüzem

'; - -// formBegin(); -// echo ''; -// echo ''; -// formEnd(); - -// formBegin(); -// echo ''; -// echo ''; -// formEnd(); - -// formBegin(); -// echo ''; -// echo ''; -// formEnd(); - - putGoogleapiStatusz($ADAT); - -?> \ No newline at end of file diff --git a/mayor-orig/www/policy/private/session/groupInfo-pre.php b/mayor-orig/www/policy/private/session/groupInfo-pre.php deleted file mode 100644 index 97864ffa..00000000 --- a/mayor-orig/www/policy/private/session/groupInfo-pre.php +++ /dev/null @@ -1,43 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/groupInfo.php b/mayor-orig/www/policy/private/session/groupInfo.php deleted file mode 100644 index 6dda377c..00000000 --- a/mayor-orig/www/policy/private/session/groupInfo.php +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/search/searchAccount-pre.php b/mayor-orig/www/policy/private/session/search/searchAccount-pre.php deleted file mode 100644 index 1ef93e95..00000000 --- a/mayor-orig/www/policy/private/session/search/searchAccount-pre.php +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/search/searchAccount.php b/mayor-orig/www/policy/private/session/search/searchAccount.php deleted file mode 100644 index 727706ee..00000000 --- a/mayor-orig/www/policy/private/session/search/searchAccount.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/search/searchGroup-pre.php b/mayor-orig/www/policy/private/session/search/searchGroup-pre.php deleted file mode 100644 index 94deeba2..00000000 --- a/mayor-orig/www/policy/private/session/search/searchGroup-pre.php +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/search/searchGroup.php b/mayor-orig/www/policy/private/session/search/searchGroup.php deleted file mode 100644 index c36d0ef6..00000000 --- a/mayor-orig/www/policy/private/session/search/searchGroup.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/mayor-orig/www/policy/private/session/session-pre.php b/mayor-orig/www/policy/private/session/session-pre.php deleted file mode 100644 index d1c65349..00000000 --- a/mayor-orig/www/policy/private/session/session-pre.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/mayor-orig/www/policy/private/session/session.php b/mayor-orig/www/policy/private/session/session.php deleted file mode 100644 index e69de29b..00000000 diff --git a/mayor-orig/www/policy/private/session/sessionAdmin-pre.php b/mayor-orig/www/policy/private/session/sessionAdmin-pre.php deleted file mode 100644 index 08b55781..00000000 --- a/mayor-orig/www/policy/private/session/sessionAdmin-pre.php +++ /dev/null @@ -1,24 +0,0 @@ -'; var_dump($ADAT); echo ''; - - } - - -?> diff --git a/mayor-orig/www/policy/private/session/sessionAdmin.php b/mayor-orig/www/policy/private/session/sessionAdmin.php deleted file mode 100644 index d1398e4f..00000000 --- a/mayor-orig/www/policy/private/session/sessionAdmin.php +++ /dev/null @@ -1,9 +0,0 @@ - -- cgit v1.2.3