[CS-Project-svn_notify] SF.net SVN: cs-project: [842] trunk/1.2/lib
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-02-17 21:57:20
|
Revision: 842 http://cs-project.svn.sourceforge.net/cs-project/?rev=842&view=rev Author: crazedsanity Date: 2008-02-17 13:57:13 -0800 (Sun, 17 Feb 2008) Log Message: ----------- Re-add redirect to setup page if config file doesn't exist. /lib/site_config.php: * if the "PROJECT__INITIALSETUP" constant isn't defined, call config::do_setup_redirect() to redirect to the setup page. /lib/config.class.php: * __construct(): -- remove confusing comment. * do_setup_redirect() [NEW]: -- redirect the the /setup page only if we're not already there. -- only add the "?from=" if there's something useful to put there. Modified Paths: -------------- trunk/1.2/lib/config.class.php trunk/1.2/lib/site_config.php Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2008-02-14 08:24:34 UTC (rev 841) +++ trunk/1.2/lib/config.class.php 2008-02-17 21:57:13 UTC (rev 842) @@ -21,7 +21,6 @@ $this->fileName = $fileName; } - //Redirect them to the setup page. if(!file_exists($this->fileName)) { $this->fileExists = FALSE; } @@ -164,5 +163,19 @@ $page->add_template_var($defaultRowName, $parsedRows); }//end build_update_interface() //------------------------------------------------------------------------- + + + + //------------------------------------------------------------------------- + public function do_setup_redirect() { + if(!preg_match('/^setup/', $_SERVER['REQUEST_URI'])) { + $goHere = '/setup'; + if(strlen($_SERVER['REQUEST_URI']) > 1) { + $goHere .= '?from='. urlencode($_SERVER['REQUEST_URI']); + } + $this->gf->conditional_header($goHere); + } + }//end do_setup_redirect() + //------------------------------------------------------------------------- }//end config{} ?> \ No newline at end of file Modified: trunk/1.2/lib/site_config.php =================================================================== --- trunk/1.2/lib/site_config.php 2008-02-14 08:24:34 UTC (rev 841) +++ trunk/1.2/lib/site_config.php 2008-02-17 21:57:13 UTC (rev 842) @@ -70,6 +70,7 @@ if(!defined("PROJECT__INITIALSETUP") || PROJECT__INITIALSETUP !== TRUE) { + $configObj->do_setup_redirect(); $config = $configObj->read_config_file(FALSE); if(($config['WORKINGONIT'] != "0" && strlen($config['WORKINGONIT'])) || strlen($config['WORKINGONIT']) > 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |