diff options
author | Eudyptula <eitan@mosenkis.net> | 2009-07-15 16:16:23 -0400 |
---|---|---|
committer | Eudyptula <eitan@mosenkis.net> | 2009-07-15 16:16:23 -0400 |
commit | 709c490155509f4c18f79f4d0632ab22ad32cc1a (patch) | |
tree | 5836ab01b99be05a05a254eca2e50de51237ae5d /shared | |
parent | Added 'Show checked' link for package adder, fixed package selector verificat... (diff) | |
download | ingenue-709c490155509f4c18f79f4d0632ab22ad32cc1a.tar.gz ingenue-709c490155509f4c18f79f4d0632ab22ad32cc1a.tar.bz2 ingenue-709c490155509f4c18f79f4d0632ab22ad32cc1a.zip |
Added config status page, moving forward and back in config wizard; added config control of user registration and invites; added 'No results' in wlca search; cleaned up use of configuration object in wizard API; added step names to module metadata; check configurations for validity before building
Diffstat (limited to 'shared')
-rw-r--r-- | shared/classes/1conf_build_common.php | 9 | ||||
-rw-r--r-- | shared/classes/configuration.php | 8 | ||||
-rw-r--r-- | shared/classes/user.php | 2 | ||||
-rw-r--r-- | shared/config.php | 2 | ||||
-rw-r--r-- | shared/functions/load_config.php | 2 | ||||
-rw-r--r-- | shared/include/defaults.php | 2 |
6 files changed, 22 insertions, 3 deletions
diff --git a/shared/classes/1conf_build_common.php b/shared/classes/1conf_build_common.php index aae1e42..35ba6e6 100644 --- a/shared/classes/1conf_build_common.php +++ b/shared/classes/1conf_build_common.php @@ -41,6 +41,15 @@ abstract class conf_build_common extends sql_row_obj { } return $opts; } + // Returns the value (or object if $get_obj is true) of the option given by $name, or null if unset + public function get_opt($name, $get_obj=false) { + $opts=$this->get_opts($get_obj); + return isset($opts[$name])?$opts[$name]:null; + } + // Returns true if the given option is set and equals the given value, false otherwise + public function opt_is($name, $val) { + return (($r=$this->get_opt($name)) !== null && $r == $val); + } // Generates a unique id and sets status to 1, writes self to db and returns id public function init() { global $S; diff --git a/shared/classes/configuration.php b/shared/classes/configuration.php index fedef12..2714732 100644 --- a/shared/classes/configuration.php +++ b/shared/classes/configuration.php @@ -31,9 +31,15 @@ class sql_configuration extends conf_build_common { 'not_null' => true, 'default' => 0 ) - ); public function build($name=null) { + $module=new module($this->module); + for ($i=1; $i<=$module->numsteps; $i++) { + $step=new wizard_step($this, $i); + if (!$step->verify()) { + return $i; + } + } $build=new sql_build(); $build->init(); $build->name=$name; diff --git a/shared/classes/user.php b/shared/classes/user.php index 91a7a46..eef0977 100644 --- a/shared/classes/user.php +++ b/shared/classes/user.php @@ -35,7 +35,7 @@ class sql_user extends sql_row_obj { ) ); - public function hasflag($flag) { + public function has_flag($flag) { return (strpos($this->flags, $flag) !== false); } } diff --git a/shared/config.php b/shared/config.php index 1ac1ae7..2f73991 100644 --- a/shared/config.php +++ b/shared/config.php @@ -15,6 +15,8 @@ $emailfrom='noreply@gentoo.org'; // Used as the From: field in emails $check_email_dns=true; // Use DNS to check the domain of submitted emails for validity // $split_setup=false; // Whether the frontend and backend are running on different hosts // Frontend options: +// $registration=false; // Whether users can create new accounts without an invite +// $invite='admin'; // Who can use the invite function: true or 'user'=users; admin=admins; false=nobody // $logview_max=1000; // The maximum number of log entries shown on one page (1000 is a good start) // $progressbar_width=350; // The width, in pixels, of the config wizard progress bar // Backend options: diff --git a/shared/functions/load_config.php b/shared/functions/load_config.php index 27e01bc..7bf94b4 100644 --- a/shared/functions/load_config.php +++ b/shared/functions/load_config.php @@ -3,7 +3,7 @@ function load_config() { require(SHARED.'/include/defaults.php'); require(SHARED.'/config.php'); $modules=explode(' ', $modules); - foreach (explode(' ', 'title sqlhost sqluser sqlpass sqldb debug modules bundlers cookiename sessionlength mod_rewrite emailfrom check_email_dns split_setup logview_max progressbar_width pkgdir_root emerge_default_opts portdir frontend_location backend_id') as $var) { + foreach (explode(' ', 'title sqlhost sqluser sqlpass sqldb debug modules bundlers cookiename sessionlength mod_rewrite emailfrom check_email_dns split_setup registration invite logview_max progressbar_width pkgdir_root emerge_default_opts portdir frontend_location backend_id') as $var) { if (isset($$var)) { $GLOBALS['conf'][$var]=$$var; } diff --git a/shared/include/defaults.php b/shared/include/defaults.php index 4065cc0..66862a8 100644 --- a/shared/include/defaults.php +++ b/shared/include/defaults.php @@ -24,6 +24,8 @@ $mod_rewrite=true; $emailfrom='noreply@noreply.net'; $check_email_dns=false; $split_setup=false; +$registration=false; +$invite='admin'; $logview_max=1000; $progressbar_width=350; $emerge_default_opts='-t -v -K --color=y --root-deps=rdeps'; |