[xoops-cvslog 6127] CVS update: xoops2jp/html/modules/legacy/kernel

Back to archive index

Minahito minah****@users*****
2007年 1月 21日 (日) 10:12:56 JST


Index: xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php
diff -u xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.30 xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.31
--- xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.30	Mon Jan 15 15:00:55 2007
+++ xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php	Sun Jan 21 10:12:56 2007
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package Legacy
- * @version $Id: Legacy_Controller.class.php,v 1.1.2.30 2007/01/15 06:00:55 minahito Exp $
+ * @version $Id: Legacy_Controller.class.php,v 1.1.2.31 2007/01/21 01:12:56 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -76,6 +76,14 @@
 	var $mSetupDebugger = null;
 	
 	/**
+	 * @public
+	 * @var XCube_Delegate
+	 * [Secret Agreement] In execute_redirect(), notice the redirection which directs toward user.php.
+	 * @remark Only the special module should access this member property.
+	 */
+	var $_mNotifyRedirectToUser = null;
+	
+	/**
 	 * @var XoopsLogger
 	 */
 	var $mLogger = null;
@@ -109,6 +117,8 @@
 
 	    $this->mSetupTextFilter->add('Legacy_TextFilter::getInstance',XCUBE_DELEGATE_PRIORITY_FINAL-1);
 
+		$this->_mNotifyRedirectToUser =& new XCube_Delegate();
+		
 		set_magic_quotes_runtime(0);	// ^^;
 	}
 	
@@ -1023,13 +1033,14 @@
 	 * wrong value, some problems may be raised. If you can't understand the
 	 * difference, use not this function but redirect_header().
 	 * 
-	 * @param string $url     redirect URL. Don't use user's variables or request.
-	 * @param int    $time    waiting time (sec)
-	 * @param string $message This string doesn't include tags.
+	 * @param string $url          redirect URL. Don't use user's variables or request.
+	 * @param int    $time         waiting time (sec)
+	 * @param string $message      This string doesn't include tags.
+	 * @param bool   $addRedirect  A value indicationg whether this method adds URL automatically for user.php.
 	 * 
 	 * @todo We'll change this function to delegate.
 	 */
-	function executeRedirect($url, $time = 1, $message = null)
+	function executeRedirect($url, $time = 1, $message = null, $addRedirect = true)
 	{
 		global $xoopsConfig, $xoopsRequestUri;
 
@@ -1052,6 +1063,12 @@
 		}
 		
 		$url = htmlspecialchars($url, ENT_QUOTES);
+		
+		// XOOPS2 Compatibility
+		if ($addRedirect && strstr($url, 'user.php')) {
+			$this->_mNotifyRedirectToUser->call(new XCube_Ref($url));
+		}
+		
 		if (defined('SID') && (! isset($_COOKIE[session_name()]) || ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']])))) {
 			if (!strstr($url, '?')) {
 				$url .= '?' . SID;


xoops-cvslog メーリングリストの案内
Back to archive index