removed $post parameter

This commit is contained in:
Roland Gruber 2006-08-14 17:29:45 +00:00
parent 44701eca3c
commit ed090ae9bf
5 changed files with 84 additions and 82 deletions

View File

@ -1,3 +1,9 @@
??? 1.0.5
Developers:
- API changes: removed $post parameters from module functions (delete_attributes(),
process_...(), display_html_...()). Use $_POST instead.
10.08.2006 1.0.4 10.08.2006 1.0.4
- added Russian translation - added Russian translation
- Samba 3: added policies for domain objects - Samba 3: added policies for domain objects

View File

@ -595,20 +595,18 @@ class baseModule {
/** /**
* Dummy function for modules which use no special options on account deletion. * Dummy function for modules which use no special options on account deletion.
* *
* @param $post The HTTP POST variables of the delete page
* @return List of LDAP operations, same as for save_attributes() * @return List of LDAP operations, same as for save_attributes()
*/ */
function delete_attributes($post) { function delete_attributes() {
return 0; return 0;
} }
/** /**
* Dummy function for modules which do not print extra HTML code on account deletion. * Dummy function for modules which do not print extra HTML code on account deletion.
* *
* @param $post HTTP POST values
* @return meta HTML code * @return meta HTML code
*/ */
function display_html_delete(&$post) { function display_html_delete() {
return 0; return 0;
} }

View File

@ -811,12 +811,10 @@ class accountContainer {
/** /**
* This function is called when the user clicks on any button on the account pages. * This function is called when the user clicks on any button on the account pages.
* It prints the HTML code of each account page. * It prints the HTML code of each account page.
*
* @param array $post HTTP POST variables
*/ */
function continue_main($post) { function continue_main() {
if ($this->subpage=='') $this->subpage='attributes'; if ($this->subpage=='') $this->subpage='attributes';
if (isset($post['form_main_reset'])) { if (isset($_POST['form_main_reset'])) {
$this->load_account($this->dn_orig); $this->load_account($this->dn_orig);
} }
else { else {
@ -824,13 +822,13 @@ class accountContainer {
if ($this->subpage=='attributes') { if ($this->subpage=='attributes') {
$result = 0; $result = 0;
// change dn // change dn
if (isset($post['suffix']) && ($post['suffix'] != '')) $this->dn = $post['suffix']; if (isset($_POST['suffix']) && ($_POST['suffix'] != '')) $this->dn = $_POST['suffix'];
// change RDN // change RDN
if (isset($post['rdn'])) $this->rdn = $post['rdn']; if (isset($_POST['rdn'])) $this->rdn = $_POST['rdn'];
// load profile // load profile
if (isset($post['selectLoadProfile']) && isset($post['loadProfile'])) { if (isset($_POST['selectLoadProfile']) && isset($_POST['loadProfile'])) {
$profile = loadAccountProfile($post['selectLoadProfile'], $this->type); $profile = loadAccountProfile($_POST['selectLoadProfile'], $this->type);
// pass profile to each module // pass profile to each module
$modules = array_keys($this->module); $modules = array_keys($this->module);
foreach ($modules as $module) $this->module[$module]->load_profile($profile); foreach ($modules as $module) $this->module[$module]->load_profile($profile);
@ -845,7 +843,7 @@ class accountContainer {
$result = 0; $result = 0;
} }
// save account // save account
if (isset($post['create'])) { if (isset($_POST['create'])) {
$errors = $this->save_account(); $errors = $this->save_account();
if (is_array($errors)) { if (is_array($errors)) {
$result = array($errors); $result = array($errors);
@ -855,26 +853,26 @@ class accountContainer {
} }
} }
if ($this->subpage=='finish') { if ($this->subpage=='finish') {
if (isset($post['createagain'])) { if (isset($_POST['createagain'])) {
// open fresh account page // open fresh account page
unset($_SESSION[$this->base]); unset($_SESSION[$this->base]);
metaRefresh("edit.php?type=" . $this->type); metaRefresh("edit.php?type=" . $this->type);
exit(); exit();
} }
if (isset($post['backmain'])) { if (isset($_POST['backmain'])) {
// Return to account list // Return to account list
unset($_SESSION[$this->base]); unset($_SESSION[$this->base]);
metaRefresh("../lists/list.php?type=" . $this->type); metaRefresh("../lists/list.php?type=" . $this->type);
exit; exit;
} }
if (isset($post['outputpdf'])) { if (isset($_POST['outputpdf'])) {
// Create / display PDf-file // Create / display PDf-file
createModulePDF(array($_SESSION[$this->base]), $post['pdfStructure']); createModulePDF(array($_SESSION[$this->base]), $_POST['pdfStructure']);
exit; exit;
} }
} }
} }
else $result = call_user_func(array(&$this->module[$this->order[$this->current_page]], 'process_'.$this->subpage), $post); else $result = call_user_func(array(&$this->module[$this->order[$this->current_page]], 'process_'.$this->subpage));
} }
// change to next page // change to next page
$errorsOccured = false; $errorsOccured = false;
@ -882,7 +880,7 @@ class accountContainer {
$errorKeys = array_keys($result); $errorKeys = array_keys($result);
for ($i = 0; $i < sizeof($errorKeys); $i++) { for ($i = 0; $i < sizeof($errorKeys); $i++) {
for ($m = 0; $m < sizeof($result[$errorKeys[$i]]); $m++) { for ($m = 0; $m < sizeof($result[$errorKeys[$i]]); $m++) {
if (($result[$errorKeys[$i]][$m][0] == 'ERROR') || ($result[$errorKeys[$i]][$m][0] == 'WARN')) { if ($result[$errorKeys[$i]][$m][0] == 'ERROR') {
$errorsOccured = true; $errorsOccured = true;
break; break;
} }
@ -891,7 +889,7 @@ class accountContainer {
} }
if (!$errorsOccured) { if (!$errorsOccured) {
// go to subpage of current module // go to subpage of current module
$postKeys = array_keys($post); $postKeys = array_keys($_POST);
for ($p = 0; $p < sizeof($postKeys); $p++) { for ($p = 0; $p < sizeof($postKeys); $p++) {
if (is_string($postKeys[$p]) && (strpos($postKeys[$p], 'form_subpage_' . $this->order[$this->current_page]) === 0)) { if (is_string($postKeys[$p]) && (strpos($postKeys[$p], 'form_subpage_' . $this->order[$this->current_page]) === 0)) {
$temp = substr($postKeys[$p], strlen($this->order[$this->current_page]) + 14); $temp = substr($postKeys[$p], strlen($this->order[$this->current_page]) + 14);
@ -902,13 +900,13 @@ class accountContainer {
} }
} }
// change module page if requested // change module page if requested
if (isset($post['form_main_main'])) { if (isset($_POST['form_main_main'])) {
$this->current_page = 0; $this->current_page = 0;
$this->subpage='attributes'; $this->subpage='attributes';
} }
else { else {
for ($i=1; $i<count($this->order); $i++ ) { for ($i=1; $i<count($this->order); $i++ ) {
if (isset($post['form_main_'.$this->order[$i]])) { if (isset($_POST['form_main_'.$this->order[$i]])) {
if ($this->module[$this->order[$i]]->module_ready()) { if ($this->module[$this->order[$i]]->module_ready()) {
$this->current_page = $i; $this->current_page = $i;
$this->subpage='attributes'; $this->subpage='attributes';
@ -1087,7 +1085,7 @@ class accountContainer {
2 => array ('kind' => 'help', 'value' => '402')); 2 => array ('kind' => 'help', 'value' => '402'));
} }
} }
else $return = call_user_func(array($this->module[$this->order[$this->current_page]], 'display_html_'.$this->subpage), $post); else $return = call_user_func(array($this->module[$this->order[$this->current_page]], 'display_html_'.$this->subpage));
$y = 5000; $y = 5000;
$z = 10000; $z = 10000;
parseHtml($this->order[$this->current_page], $return, array(), false, $y, $z, $this->type); parseHtml($this->order[$this->current_page], $return, array(), false, $y, $z, $this->type);

View File

@ -81,6 +81,6 @@ if (get_magic_quotes_gpc() == 1) {
} }
// show account page // show account page
$_SESSION['account']->continue_main($_POST); $_SESSION['account']->continue_main();
?> ?>

View File

@ -148,7 +148,7 @@ if ($_POST['delete']) {
// load attributes // load attributes
foreach ($module as $singlemodule) { foreach ($module as $singlemodule) {
// load changes // load changes
$temp = $_SESSION['account']->module[$singlemodule]->delete_attributes($_POST); $temp = $_SESSION['account']->module[$singlemodule]->delete_attributes();
if (is_array($temp)) { if (is_array($temp)) {
// merge changes // merge changes
$DNs = array_keys($temp); $DNs = array_keys($temp);