support to change self service profile while input check is done
This commit is contained in:
parent
d3e3df760e
commit
2e9ec7fd3d
|
@ -1296,9 +1296,10 @@ abstract class baseModule {
|
||||||
* occured the function returns an empty array.
|
* 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 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
|
* @return array error messages
|
||||||
*/
|
*/
|
||||||
public function checkSelfServiceSettings(&$options) {
|
public function checkSelfServiceSettings(&$options, &$profile) {
|
||||||
// needs to be implemented by the subclasses, if needed
|
// needs to be implemented by the subclasses, if needed
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ function loadSelfServiceProfile($name, $scope) {
|
||||||
if (is_file($file) === True) {
|
if (is_file($file) === True) {
|
||||||
$file = @fopen($file, "r");
|
$file = @fopen($file, "r");
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$data = fread($file, 10000);
|
$data = fread($file, 100000);
|
||||||
$profile = unserialize($data);
|
$profile = unserialize($data);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
|
@ -255,14 +255,15 @@ function getSelfServiceSettings($scope, $profile) {
|
||||||
*
|
*
|
||||||
* @param string $scope account type
|
* @param string $scope account type
|
||||||
* @param array $options hash array containing all options (name => array(...))
|
* @param array $options hash array containing all options (name => array(...))
|
||||||
|
* @param selfServiceProfile $profile profile
|
||||||
* @return array list of error messages
|
* @return array list of error messages
|
||||||
*/
|
*/
|
||||||
function checkSelfServiceSettings($scope, &$options) {
|
function checkSelfServiceSettings($scope, &$options, &$profile) {
|
||||||
$return = array();
|
$return = array();
|
||||||
$modules = getAvailableModules($scope);
|
$modules = getAvailableModules($scope);
|
||||||
for ($i = 0; $i < sizeof($modules); $i++) {
|
for ($i = 0; $i < sizeof($modules); $i++) {
|
||||||
$m = new $modules[$i]($scope);
|
$m = new $modules[$i]($scope);
|
||||||
$errors = $m->checkSelfServiceSettings($options);
|
$errors = $m->checkSelfServiceSettings($options, $profile);
|
||||||
$return = array_merge($return, $errors);
|
$return = array_merge($return, $errors);
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -313,7 +314,10 @@ class selfServiceProfile {
|
||||||
public $mainPageText;
|
public $mainPageText;
|
||||||
|
|
||||||
/** input fields
|
/** 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;
|
public $inputFields;
|
||||||
|
|
Loading…
Reference in New Issue