[Commits] r673 - in trunk/webinterface: core mods/super/vservers
new-commit at lists.openvcp.org
new-commit at lists.openvcp.org
Tue Jul 7 10:20:13 UTC 2009
Author: ftx
Date: 2009-07-07 10:20:13 +0000 (Tue, 07 Jul 2009)
New Revision: 673
Modified:
trunk/webinterface/core/Auth.php
trunk/webinterface/core/DB.php
trunk/webinterface/core/OpenVCP.php
trunk/webinterface/mods/super/vservers/navi.php
Log:
cli mode workaround
Modified: trunk/webinterface/core/Auth.php
===================================================================
--- trunk/webinterface/core/Auth.php 2009-06-01 12:50:44 UTC (rev 672)
+++ trunk/webinterface/core/Auth.php 2009-07-07 10:20:13 UTC (rev 673)
@@ -86,6 +86,8 @@
*/
public function onConstruct()
{
+ if(OpenVCP::inClimode()) return;
+
session_start();
if(OpenVCP::calledMod(true) != 'auth')
{
@@ -178,6 +180,7 @@
*/
public function start_session($user, $password)
{
+ if(OpenVCP::inClimode()) return;
session_start();
$db =& OpenVCP::call('DB', 'getReference');
$LOG =& OpenVCP::call('Log', 'getReference');
Modified: trunk/webinterface/core/DB.php
===================================================================
--- trunk/webinterface/core/DB.php 2009-06-01 12:50:44 UTC (rev 672)
+++ trunk/webinterface/core/DB.php 2009-07-07 10:20:13 UTC (rev 673)
@@ -73,7 +73,15 @@
*/
protected $select_numrows = 0;
+
/**
+ * Contains latest sql query
+ *
+ * @var string
+ */
+ protected $latestqry = '';
+
+ /**
* @internal
*/
public function onConstruct(){
@@ -355,7 +363,8 @@
}
}
- //echo "SELECT $f FROM $t $c $o $l\n";
+ $this->latestqry = "SELECT $f FROM $t $c $o $l\n";
+
if(!$result = @mysql_query("SELECT $f FROM $t $c $o $l")){
OpenVCP::coreError("MySQL query failed, returned error message: %1%", 1, mysql_error());
return false;
@@ -375,7 +384,13 @@
}
}
+ public function getLatestQuery()
+ {
+ return $this->latestqry;
+ }
+
+
public function select_numrows()
{
return $this->select_numrows;
Modified: trunk/webinterface/core/OpenVCP.php
===================================================================
--- trunk/webinterface/core/OpenVCP.php 2009-06-01 12:50:44 UTC (rev 672)
+++ trunk/webinterface/core/OpenVCP.php 2009-07-07 10:20:13 UTC (rev 673)
@@ -151,6 +151,7 @@
protected static $lastTextdomain = "";
+ protected static $climode = false;
public static function main(){
@@ -277,7 +278,16 @@
}
}
-
+ public static function enableClimode()
+ {
+ self::$climode = true;
+ }
+
+ public static function inClimode()
+ {
+ return self::$climode;
+ }
+
public static function setTextdomain($domain)
{
bindtextdomain($domain, self::$mainConfig['localeDir']);
@@ -326,10 +336,13 @@
*
* @param string $url
*/
- public static function gotoURL($url){
- ob_end_clean();
- header('Location: ' . self::makeURL($url));
- die("redirect to: ".self::makeURL($url));
+ public static function gotoURL($url){
+ if(!self::$climode)
+ {
+ ob_end_clean();
+ header('Location: ' . self::makeURL($url));
+ die("redirect to: ".self::makeURL($url));
+ }
}
/**
Modified: trunk/webinterface/mods/super/vservers/navi.php
===================================================================
--- trunk/webinterface/mods/super/vservers/navi.php 2009-06-01 12:50:44 UTC (rev 672)
+++ trunk/webinterface/mods/super/vservers/navi.php 2009-07-07 10:20:13 UTC (rev 673)
@@ -27,7 +27,7 @@
$GUI->addContentMenuHead(_("VServer"));
$GUI->addContentMenuSub("", _("overview"));
$GUI->addContentMenuSub("add", _("add vserver"));
-if(isset($vserver))
+if(is_object($vserver))
{
require_once("vsnavi.php");
}
More information about the Commits
mailing list