support to change self service profile while input check is done

This commit is contained in:
Roland Gruber 2012-07-08 17:43:23 +00:00
parent d3e3df760e
commit 2e9ec7fd3d
2 changed files with 10 additions and 5 deletions

View File

@ -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();
}

View File

@ -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(<module> => array(array('name' => <group name>, 'fields' => array(<field1>, <field2>))))
* Format: array(
* <br> array(array('name' => <group name 1>, 'fields' => array(<field1>, <field2>))),
* <br> array(array('name' => <group name 2>, 'fields' => array(<field3>, <field4>)))
* <br> )
*
*/
public $inputFields;