updated checkProfileOptions
This commit is contained in:
parent
e2c1420e25
commit
6592b0911c
|
@ -151,7 +151,7 @@ function check_module_conflicts($selected, $deps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns an array with all available user module names
|
// returns an array with all available user module names
|
||||||
// $scope = suer, group, host, ....
|
// $scope = user, group, host, ...
|
||||||
function getAvailableModules($scope) {
|
function getAvailableModules($scope) {
|
||||||
// get module names.
|
// get module names.
|
||||||
$dir = opendir('../../lib/modules');
|
$dir = opendir('../../lib/modules');
|
||||||
|
@ -175,14 +175,17 @@ function getProfileOptions($scope) {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkProfileOptions($scope, $post) {
|
// checks if the profile options are valid
|
||||||
// type = user, group, host, ...
|
// $scope: user, group, host, ...
|
||||||
if (!isset($_SESSION['profile_account'])) {
|
// $options: an hash array containing all options (name => array(...))
|
||||||
// create new object
|
function checkProfileOptions($scope, $options) {
|
||||||
$_SESSION['profile_account'] = new accountContainer($scope, 'profile_account');
|
$return = array();
|
||||||
$_SESSION['profile_account']->new_account();
|
$modules = getAvailableModules($scope);
|
||||||
|
for ($i = 0; $i < sizeof($modules); $i++) {
|
||||||
|
$errors = call_user_func(array($modules[$i], "check_profileOptions"), $scope, $options);
|
||||||
|
$return = array_merge($return, $errors);
|
||||||
}
|
}
|
||||||
return $_SESSION['profile_account']->process_profile($post);
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -713,6 +716,7 @@ class accountContainer {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO remove this function?
|
||||||
function proccess_profile($post) {
|
function proccess_profile($post) {
|
||||||
$return = array();
|
$return = array();
|
||||||
$module = array_keys ($this->module);
|
$module = array_keys ($this->module);
|
||||||
|
|
Loading…
Reference in New Issue