From 2e9ec7fd3dd77d6a997962ead85a76cfd8391603 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 8 Jul 2012 17:43:23 +0000 Subject: [PATCH] support to change self service profile while input check is done --- lam/lib/baseModule.inc | 3 ++- lam/lib/selfService.inc | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index 83020172..287a5093 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -1296,9 +1296,10 @@ abstract class baseModule { * occured the function returns an empty array. * * @param array $options hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements. + * @param selfServiceProfile $profile self service profile * @return array error messages */ - public function checkSelfServiceSettings(&$options) { + public function checkSelfServiceSettings(&$options, &$profile) { // needs to be implemented by the subclasses, if needed return array(); } diff --git a/lam/lib/selfService.inc b/lam/lib/selfService.inc index e1b24692..d8ff90cc 100644 --- a/lam/lib/selfService.inc +++ b/lam/lib/selfService.inc @@ -172,7 +172,7 @@ function loadSelfServiceProfile($name, $scope) { if (is_file($file) === True) { $file = @fopen($file, "r"); if ($file) { - $data = fread($file, 10000); + $data = fread($file, 100000); $profile = unserialize($data); fclose($file); } @@ -255,14 +255,15 @@ function getSelfServiceSettings($scope, $profile) { * * @param string $scope account type * @param array $options hash array containing all options (name => array(...)) +* @param selfServiceProfile $profile profile * @return array list of error messages */ -function checkSelfServiceSettings($scope, &$options) { +function checkSelfServiceSettings($scope, &$options, &$profile) { $return = array(); $modules = getAvailableModules($scope); for ($i = 0; $i < sizeof($modules); $i++) { $m = new $modules[$i]($scope); - $errors = $m->checkSelfServiceSettings($options); + $errors = $m->checkSelfServiceSettings($options, $profile); $return = array_merge($return, $errors); } return $return; @@ -313,7 +314,10 @@ class selfServiceProfile { public $mainPageText; /** input fields - * Format: array( => array(array('name' => , 'fields' => array(, )))) + * Format: array( + *
array(array('name' => , 'fields' => array(, ))), + *
array(array('name' => , 'fields' => array(, ))) + *
) * */ public $inputFields;