diff options
Diffstat (limited to 'mayor-orig/www/include/modules/session')
9 files changed, 0 insertions, 389 deletions
diff --git a/mayor-orig/www/include/modules/session/accountInfo.php b/mayor-orig/www/include/modules/session/accountInfo.php deleted file mode 100644 index b14a8edb..00000000 --- a/mayor-orig/www/include/modules/session/accountInfo.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/* - Modules: base/session - - share --> function getAccountInfo($userAccount, $toPolicy = '') { - share --> function getUserInfo($userAccount, $toPolicy = '') { - function changeAccountInfo($userAccount, $toPolicy = '') { -*/ - - require('include/share/session/accountInfo.php'); - -########################################################### -# changeAccountInfo - felhasználói információk módosítása -########################################################### - - function changeAccountInfo($userAccount, $toPolicy = _POLICY) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/accountInfo.php'); - $func = $AUTH[$toPolicy]['backend'].'ChangeAccountInfo'; - return $func($userAccount, $toPolicy); - - - } - - function getUserSettings($userAccount,$toPolicy = _POLICY) { - - $q = "SELECT * FROM settings WHERE userAccount='%s' AND policy='%s'"; - $res = db_query($q, array('modul'=>'login','values'=>array($userAccount,$toPolicy), 'result'=>'record')); - return $res; - - } - - function setUserSettings($userAccount,$toPolicy,$ADAT) { - - if (!isset($ADAT['skin']) || $ADAT['skin']=='') { - $q = "UPDATE settings SET skin=NULL WHERE userAccount='%s' AND policy='%s'"; - $res = db_query($q, array('modul'=>'login','values'=>array($userAccount,$toPolicy))); - } else { - $q = "UPDATE settings SET skin='%s' WHERE userAccount='%s' AND policy='%s'"; - $res = db_query($q, array('modul'=>'login','values'=>array($ADAT['skin'],$userAccount,$toPolicy))); - } - return $res; - - } - - function setEduroamRecord($ADAT) { - - // ALTER TABLE eduroam ADD UNIQUE INDEX (userAccount,policy); - // ALTER TABLE eduroam ADD UNIQUE INDEX (eduroamUID); - // https://wiki.niif.hu/index.php?title=Sulinet_felhaszn%C3%A1l%C3%B3k_t%C3%B6meges_felvitele - - $q = "UPDATE eduroam SET eduroamPASSWORD='%s', modositasDt = NOW() WHERE userAccount='%s' AND policy='%s'"; - $res = db_query($q, array('modul'=>'login','values'=>array($ADAT['eduroamPASSWORD'],$userAccount,$toPolicy))); - - } - - function createEduroamSettings($ADAT) { - - $q = "INSERT INTO eduroam (userAccount,policy,eduroamUID,eduroamPASSWORD,eduroamAFFILIATION,eduroamDOMAIN) - VALUES ('%s','%s','%s','%s','%s','%s')"; - $values = array( - $ADAT['userAccount'], - $ADAT['policy'], - $ADAT['eduroamUID'], - $ADAT['eduroamPASSWORD'], - $ADAT['eduroamAFFILIATION'], - $ADAT['eduroamDOMAIN'], - ); - $res = db_query($q, array('modul'=>'login','values'=>$values)); - return $res; - } - - function getEduroamSettings($userAccount,$toPolicy,$ADAT) { - - $res = false; - if (_ACCESS_AS == _ADMIN_ACCESS) { - $userAccoungt = ($userAccount); - $toPolicy = ($toPolicy); - } else { - $userAccount = (_USERACCOUNT); - $toPolicy = (_POLICY); - } - - if ($toPolicy == 'private') { - $q = "SELECT * FROM eduroam WHERE userAccount='%s' AND policy='%s'"; - $res = db_query($q, array('modul'=>'login','values'=>array($userAccount,$toPolicy), 'result'=>'record')); - } - return $res; - - } - -?> diff --git a/mayor-orig/www/include/modules/session/base/base.php b/mayor-orig/www/include/modules/session/base/base.php deleted file mode 100644 index efc39324..00000000 --- a/mayor-orig/www/include/modules/session/base/base.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/* - Module: base/session -*/ - - // Attribútumok nyelvi konstansai - - if (file_exists('lang/'.$lang.'/share/session/attrs.php')) { - require('lang/'.$lang.'/share/session/attrs.php'); - } elseif (file_exists('lang/'._DEFAULT_LANG.'/share/session/attrs.php')) { - require('lang/'._DEFAULT_LANG.'/share/session/attrs.php'); - } - - // Attribútum információk - if (file_exists('include/share/session/attrs.php')) { - require('include/share/session/attrs.php'); - } - -?> diff --git a/mayor-orig/www/include/modules/session/createAccount.php b/mayor-orig/www/include/modules/session/createAccount.php deleted file mode 100644 index 6222ed76..00000000 --- a/mayor-orig/www/include/modules/session/createAccount.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/* - Modules: base/session -*/ - - function createAccount($userCn, $userAccount, $userPassword, $toPolicy = _POLICY, $SET = array('category' => null, 'container' => null, 'groups' => '', 'policyAttrs' => array())) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/createAccount.php'); - $func = $AUTH[$toPolicy]['backend'].'CreateAccount'; - $r = $func($userCn, $userAccount, $userPassword, $toPolicy, $SET); - $_SESSION['lastCreatedAccount'] = $userAccount; - - return $r; - - } - -?> diff --git a/mayor-orig/www/include/modules/session/createGroup.php b/mayor-orig/www/include/modules/session/createGroup.php deleted file mode 100644 index 69b2bb45..00000000 --- a/mayor-orig/www/include/modules/session/createGroup.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/* - Modules: base/session -*/ - - function createGroup($groupCn, $groupDesc, $toPolicy = _POLICY, $SET = array('category' => null, 'container' => null, 'policyAttrs' => array())) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/createGroup.php'); - $func = $AUTH[$toPolicy]['backend'].'CreateGroup'; - return $func($groupCn, $groupDesc, $toPolicy, $SET); - - } - -?> diff --git a/mayor-orig/www/include/modules/session/download.php b/mayor-orig/www/include/modules/session/download.php deleted file mode 100644 index 47d3bdb7..00000000 --- a/mayor-orig/www/include/modules/session/download.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - - $allowedExtensions = array( - - // archives - 'zip' => 'application/zip', - 'tgz' => 'application/tar', - - // documents - 'pdf' => 'application/pdf', - 'doc' => 'application/msword', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/vnd.ms-powerpoint', - 'csv' => 'application/vnd.ms-excel', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - - // executables - 'exe' => 'application/octet-stream', - - // text - 'xml' => 'text/xml', - - // images - 'gif' => 'image/gif', - 'png' => 'image/png', - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - - // audio - 'mp3' => 'audio/mpeg', - 'wav' => 'audio/x-wav', - - // video - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'mov' => 'video/quicktime', - 'avi' => 'video/x-msvideo' - ); - - $allowedMimeTypes = array( - 'application/zip', - 'application/tar', - 'application/pdf', - 'application/msword', - 'application/vnd.ms-excel', - 'application/vnd.ms-powerpoint', - 'application/octet-stream', - 'text/xml', - 'image/gif', - 'image/png', - 'image/jpeg', - 'audio/mpeg', - 'audio/x-wav', - 'video/mpeg', - 'video/quicktime', - 'video/x-msvideo', - 'application/vnd.oasis.opendocument.spreadsheet' - ); - - function passFile($ADAT) { - if (in_array($ADAT['ext'],array('jpg','jpeg','png'))) passFile_image($ADAT); - else passFile_other($ADAT); - die(); - } - - function passFile_image($ADAT) { - ob_clean(); - ignore_user_abort(true); - set_time_limit(0); - // Getting headers sent by the client. - $headers = apache_request_headers(); - $fn = $ADAT['path'] ; - // Checking if the client is validating his cache and if it is current. - if (isset($headers['If-Modified-Since']) && (strtotime($headers['If-Modified-Since']) == filemtime($fn))) { - // Client's cache IS current, so we just respond '304 Not Modified'. - header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($fn)).' GMT', true, 304); - header('Expires: '.gmdate('D, d M Y H:i:s', strtotime('+10 day')).' GMT', true); - header("Cache-Control: max-age=604800, public", true); - header("Pragma: public", true); - } else { - header("Pragma: public", true); - header("Cache-Control: max-age=604800, public", true); - header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($fn)).' GMT', true, 200); - header('Expires: '.gmdate('D, d M Y H:i:s', strtotime('+10 day')).' GMT', true); - header("Content-Length: " . $ADAT['size'], true); - header('Content-type: '.$ADAT['mime'], true); - echo file_get_contents($fn); - } - } - - function passFile_other($ADAT) { - ob_clean(); - header('Content-type: '.$ADAT['mime']); - header("Pragma: public"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - header("Cache-Control: public"); - header("Content-Description: File Transfer"); - header("Content-Type: ".$ADAT['mime']); - if (!isset($ADAT['pure'])) // akkor force download as - header('Content-Disposition: attachment; filename="'.$ADAT['file'].'"'); - header("Content-Transfer-Encoding: binary"); - header("Content-Length: " . $ADAT['size']); - echo file_get_contents($ADAT['path']); - } - -?> diff --git a/mayor-orig/www/include/modules/session/groupInfo.php b/mayor-orig/www/include/modules/session/groupInfo.php deleted file mode 100644 index fd46afee..00000000 --- a/mayor-orig/www/include/modules/session/groupInfo.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/* - Modules: base/session - - function getGroupInfo($groupCn, $toPolicy = '') { - function changeGroupInfo($userAccount, $toPolicy = '') { -*/ - -###################################################### -# getGroupInfo - csoport információk (backend) -###################################################### - - function getGroupInfo($groupCn, $toPolicy = _POLICY, $SET = array('withNewAccounts' => true)) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/accountInfo.php'); - $func = $AUTH[$toPolicy]['backend'].'GetGroupInfo'; - return $func($groupCn, $toPolicy, $SET); - - - } - -########################################################### -# changeGroupInfo - csoport információk módosítása -########################################################### - - function changeGroupInfo($groupCn, $toPolicy = _POLICY) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/accountInfo.php'); - $func = $AUTH[$toPolicy]['backend'].'ChangeGroupInfo'; - return $func($groupCn, $toPolicy); - - - } -?> diff --git a/mayor-orig/www/include/modules/session/search/searchAccount.php b/mayor-orig/www/include/modules/session/search/searchAccount.php deleted file mode 100644 index 796a7423..00000000 --- a/mayor-orig/www/include/modules/session/search/searchAccount.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/* - Module: base/session -*/ - -############################################################## -# searchAccount - felhasználó kereső függvény -############################################################## - - - function searchAccount($attr, $pattern, $searchAttrs = array('userCn'), $toPolicy = _POLICY) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/search/searchAccount.php'); - $func = $AUTH[$toPolicy]['backend'].'SearchAccount'; - - return $func($attr, $pattern, $searchAttrs, $toPolicy); - - } - -############################################################## -# deleteAccount - felhasználó törlése -############################################################## - - function deleteAccount($userAccount, $toPolicy = _POLICY) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/search/searchAccount.php'); - $func = $AUTH[$toPolicy]['backend'].'DeleteAccount'; - return $func($userAccount, $toPolicy); - - } - - -?> diff --git a/mayor-orig/www/include/modules/session/search/searchGroup.php b/mayor-orig/www/include/modules/session/search/searchGroup.php deleted file mode 100644 index f44f9aa2..00000000 --- a/mayor-orig/www/include/modules/session/search/searchGroup.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/* - Module: base/session -*/ - -############################################################## -# searchGroup - csoport kereső függvény -############################################################## - - function searchGroup($attr, $pattern, $searchAttrs = array('groupCn, groupDesc'), $toPolicy = _POLICY) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/search/searchAccount.php'); - $func = $AUTH[$toPolicy]['backend'].'SearchGroup'; - return $func($attr, $pattern, $searchAttrs, $toPolicy); - - } - -############################################################## -# deleteGroup - csoport torlese -############################################################## - - function deleteGroup($groupCn, $toPolicy = _POLICY) { - - global $AUTH; - - require_once('include/backend/'.$AUTH[$toPolicy]['backend'].'/session/search/searchAccount.php'); - $func = $AUTH[$toPolicy]['backend'].'DeleteGroup'; - return $func($groupCn, $toPolicy); - - } - -?> diff --git a/mayor-orig/www/include/modules/session/sessionAdmin.php b/mayor-orig/www/include/modules/session/sessionAdmin.php deleted file mode 100644 index ff3e99b8..00000000 --- a/mayor-orig/www/include/modules/session/sessionAdmin.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - - function getSessions() { - - $W = array(); - if (intval(_SESSION_MAX_TIME) != 0) $W[] = "dt + INTERVAL ".intval(_SESSION_MAX_TIME)." HOUR > NOW()"; - if (intval(_SESSION_MAX_IDLE_TIME) != 0) $W[] = "activity + INTERVAL ".intval(_SESSION_MAX_IDLE_TIME)." HOUR > NOW()"; - $q = "SELECT userAccount,dt,policy,sessionID,userCn,studyId,skin,lang,activity,sessionCookie,ip FROM session LEFT JOIN loginLog USING (policy,userAccount,dt)"; - if (count($W) > 0) $q .= " WHERE ".implode(' AND ', $W); - $q .= " ORDER BY activity DESC"; - - $ret = db_query($q, array('fv' => 'getSessions', 'modul' => 'login', 'result' => 'indexed')); - return $ret; - } - - function deleteSession($sessionID, $policy) { - - $q = "DELETE FROM session WHERE sessionID='%s' AND policy='%s'"; - $v = array($sessionID, $policy); - return db_query($q, array('fv' => 'deleteSession','modul' => 'login', 'values' => $v)); - - } - -?> |