[pLog-svn] r1013 - in plog/trunk: class/net/http/session locale
templates/admin
oscar at devel.plogworld.net
oscar at devel.plogworld.net
Tue Feb 8 23:05:57 GMT 2005
Author: oscar
Date: 2005-02-08 23:05:56 +0000 (Tue, 08 Feb 2005)
New Revision: 1013
Modified:
plog/trunk/class/net/http/session/sessionmanager.class.php
plog/trunk/locale/locale_en_UK.php
plog/trunk/templates/admin/globalsettings_general.template
Log:
fixed issue 221 per jon's request.
Modified: plog/trunk/class/net/http/session/sessionmanager.class.php
===================================================================
--- plog/trunk/class/net/http/session/sessionmanager.class.php 2005-02-08 22:55:57 UTC (rev 1012)
+++ plog/trunk/class/net/http/session/sessionmanager.class.php 2005-02-08 23:05:56 UTC (rev 1013)
@@ -24,6 +24,9 @@
*/
function init()
{
+ // this needs to be done before anything else
+ SessionManager::setSessionSavePath();
+
// this needs to be done before the session is started
SessionManager::setSessionCookiePath();
SessionManager::setSessionCookieDomain();
@@ -87,5 +90,28 @@
ini_set( "session.cookie_domain", $domain );
}
}
+
+ /**
+ * sets the folder where sessions should be saved, in case we'd like to save
+ * them somewhere else...
+ *
+ * @static
+ */
+ function setSessionSavePath()
+ {
+ $config =& Config::getConfig();
+ $sessionFolder = $config->getValue( "session_save_path" );
+ if( isset( $sessionFolder )) {
+ // check if the folder is readable
+ if( !File::isReadable( $sessionFolder )) {
+ throw( new Exception( "Sessions should be saved in $sessionFolder but it is not readable!" ));
+ die();
+ }
+ // if everything ok, we can continue...
+ session_save_path( $sessionFolder );
+ }
+
+ return true;
+ }
}
?>
Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php 2005-02-08 22:55:57 UTC (rev 1012)
+++ plog/trunk/locale/locale_en_UK.php 2005-02-08 23:05:56 UTC (rev 1013)
@@ -692,6 +692,7 @@
$messages['help_minimum_password_length'] = 'Minimun length for passwords';
$messages['help_xhtml_converter_enabled'] = 'If enabled, pLog will try to convert all HTML code into proper XHTML code';
$messages['help_xhtml_converter_aggressive_mode_enabled'] = 'If enabled, pLog will try even harder to generate XHTML out of HTML code, but it will be more prone to errors';
+$messages['help_session_save_path'] = 'Please use this setting to change the folder where pLog stores its session data, via the PHP function session_save_path() Please make sure that the folder is writable by the web server. Leave empty to use PHP\'s default session folder';
// summary settings
$messages['help_summary_page_show_max'] = 'Number of items that will be shown in the summary page. This setting control all lists in the summary page (recent articles, most active blogs, etc)';
$messages['help_summary_blogs_per_page'] = 'Number of blogs per page in the "Blogs List" section';
Modified: plog/trunk/templates/admin/globalsettings_general.template
===================================================================
--- plog/trunk/templates/admin/globalsettings_general.template 2005-02-08 22:55:57 UTC (rev 1012)
+++ plog/trunk/templates/admin/globalsettings_general.template 2005-02-08 23:05:56 UTC (rev 1013)
@@ -245,4 +245,10 @@
<input class="radio" type="radio" name="config[xhtml_converter_aggresive_mode_enabled]" value="1" {if $xhtml_converter_aggresive_mode_enabled == 1 } checked="checked" {/if} />{$locale->tr("yes")}
<input class="radio" type="radio" name="config[xhtml_converter_aggresive_mode_enabled]" value="0" {if $xhtml_converter_aggresive_mode_enabled == 0 } checked="checked" {/if} />{$locale->tr("no")}
</div>
+ <!-- session_save_path -->
+ <div class="field">
+ <label for="config[session_save_path]">session_save_path</label>
+ <div class="formHelp">{$locale->tr("help_session_save_path")}</div>
+ <input style="width:100%" type="text" name="config[session_save_path]" value="{$session_save_path}"/>
+ </div>
</div>
\ No newline at end of file
More information about the pLog-svn
mailing list