aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/www/policy/private/session/search
diff options
context:
space:
mode:
Diffstat (limited to 'mayor-orig/www/policy/private/session/search')
-rw-r--r--mayor-orig/www/policy/private/session/search/searchAccount-pre.php28
-rw-r--r--mayor-orig/www/policy/private/session/search/searchAccount.php16
-rw-r--r--mayor-orig/www/policy/private/session/search/searchGroup-pre.php25
-rw-r--r--mayor-orig/www/policy/private/session/search/searchGroup.php16
4 files changed, 85 insertions, 0 deletions
diff --git a/mayor-orig/www/policy/private/session/search/searchAccount-pre.php b/mayor-orig/www/policy/private/session/search/searchAccount-pre.php
new file mode 100644
index 00000000..2108f631
--- /dev/null
+++ b/mayor-orig/www/policy/private/session/search/searchAccount-pre.php
@@ -0,0 +1,28 @@
+<?php
+/*
+ Module: base/session
+*/
+
+ if (_RIGHTS_OK !== true) die();
+
+ $toPolicy = readVariable($_POST['toPolicy'], 'enum', _POLICY, $POLICIES);
+
+ define('__ADMIN', memberOf(_USERACCOUNT, $AUTH[_POLICY]['adminGroup']));
+ define('__DIAKADMIN', memberOf(_USERACCOUNT, 'diakadmin'));
+
+ // valójában így sem jó, mert a lekérdezett backend-től kellene függővé teni a keresés mezőket...
+ if ($AUTH[_POLICY]['backend'] == 'ad') $searchAttrList = array('userCn', 'userAccount', 'uidNumber', 'studyId');
+ else $searchAttrList = array('userCn', 'userAccount', 'studyId');
+
+ if ($action == 'searchAccount') {
+ $attr = readVariable($_POST['attr'], 'enum', 'userCn', $searchAttrList);
+ $pattern = readVariable($_POST['pattern'], 'string');
+ $searchResult = searchAccount($attr, $pattern, $searchAttrList, $toPolicy);
+ } elseif ($action == 'deleteAccount' and __ADMIN === true) {
+ $userAccount = readVariable($_POST['userAccount'], 'string');
+ deleteAccount($userAccount, $toPolicy);
+ } else {
+ echo $action;
+ }
+
+?>
diff --git a/mayor-orig/www/policy/private/session/search/searchAccount.php b/mayor-orig/www/policy/private/session/search/searchAccount.php
new file mode 100644
index 00000000..8cfe1d75
--- /dev/null
+++ b/mayor-orig/www/policy/private/session/search/searchAccount.php
@@ -0,0 +1,16 @@
+<?php
+/*
+ Module: base/session
+*/
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $attr, $pattern, $searchResult, $searchAttrList, $toPolicy;
+
+ putSearchAccountForm($attr, $pattern, $searchAttrList, $toPolicy);
+
+ if (is_array($searchResult)) {
+ putSearchResultBox($searchResult, $toPolicy);
+ }
+
+?>
diff --git a/mayor-orig/www/policy/private/session/search/searchGroup-pre.php b/mayor-orig/www/policy/private/session/search/searchGroup-pre.php
new file mode 100644
index 00000000..94deeba2
--- /dev/null
+++ b/mayor-orig/www/policy/private/session/search/searchGroup-pre.php
@@ -0,0 +1,25 @@
+<?php
+/*
+ Module: base/session
+*/
+
+ if (_RIGHTS_OK !== true) die();
+
+ $toPolicy = readVariable($_POST['toPolicy'], 'enum', _POLICY, $POLICIES);
+
+ define('__ADMIN', memberOf(_USERACCOUNT, $AUTH[_POLICY]['adminGroup']));
+ define('__DIAKADMIN', memberOf(_USERACCOUNT, 'diakadmin'));
+
+ $searchAttrs = array('groupCn', 'groupDesc');
+ if ($action == 'searchGroup') {
+ $attr = readVariable($_POST['attr'], 'enum', 'groupCn', $searchAttrs);
+ $pattern = readVariable($_POST['pattern'],'html');
+ $searchResult = searchGroup($attr, $pattern, $searchAttrs, $toPolicy);
+ } elseif (__ADMIN ===true && $action == 'deleteGroup') {
+ $groupCn = readVariable($_POST['groupCn'], 'html'); // nem biztos hogy id - bizos nem id, hanem a csoport neve
+ deleteGroup($groupCn, $toPolicy);
+ } else {
+ echo $action;
+ }
+
+?>
diff --git a/mayor-orig/www/policy/private/session/search/searchGroup.php b/mayor-orig/www/policy/private/session/search/searchGroup.php
new file mode 100644
index 00000000..c36d0ef6
--- /dev/null
+++ b/mayor-orig/www/policy/private/session/search/searchGroup.php
@@ -0,0 +1,16 @@
+<?php
+/*
+ Module: base/session
+*/
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $attr, $pattern, $searchAttrs, $searchResult, $toPolicy;
+
+ putSearchGroupForm($attr, $pattern, $searchAttrs, $toPolicy);
+
+ if (is_array($searchResult)) {
+ putSearchResultBox($searchResult, $toPolicy);
+ }
+
+?>