Merge branch 'master' of git://github.com/sebsauvage/Shaarli
This commit is contained in:
commit
29562e2d07
2 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
![Shaarli logo](http://sebsauvage.net/wiki/lib/exe/fetch.php?media=php:php_shaarli:php_shaarli_logo_inkscape_w600_transp-nq8.png)
|
![Shaarli logo](http://sebsauvage.net/wiki/lib/exe/fetch.php?media=php:php_shaarli:php_shaarli_logo_inkscape_w600_transp-nq8.png)
|
||||||
|
|
||||||
Shaarli 0.0.40 beta
|
Shaarli
|
||||||
The personal, minimalist, super-fast, no-database delicious clone.
|
The personal, minimalist, super-fast, no-database delicious clone.
|
||||||
|
|
||||||
You want to share the links you discover ? Shaarli is a minimalist delicious clone you can install on your own website.
|
You want to share the links you discover ? Shaarli is a minimalist delicious clone you can install on your own website.
|
||||||
|
|
10
index.php
10
index.php
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
// Shaarli 0.0.40 beta - Shaare your links...
|
// Shaarli 0.0.41 beta - Shaare your links...
|
||||||
// The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net
|
// The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net
|
||||||
// http://sebsauvage.net/wiki/doku.php?id=php:shaarli
|
// http://sebsauvage.net/wiki/doku.php?id=php:shaarli
|
||||||
// Licence: http://www.opensource.org/licenses/zlib-license.php
|
// Licence: http://www.opensource.org/licenses/zlib-license.php
|
||||||
|
@ -28,14 +28,14 @@ $GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400 ; // Updates check frequency
|
||||||
// Optionnal config file.
|
// Optionnal config file.
|
||||||
if (is_file($GLOBALS['config']['DATADIR'].'/options.php')) require($GLOBALS['config']['DATADIR'].'/options.php');
|
if (is_file($GLOBALS['config']['DATADIR'].'/options.php')) require($GLOBALS['config']['DATADIR'].'/options.php');
|
||||||
|
|
||||||
define('shaarli_version','0.0.40 beta');
|
define('shaarli_version','0.0.41 beta');
|
||||||
define('PHPPREFIX','<?php /* '); // Prefix to encapsulate data in php code.
|
define('PHPPREFIX','<?php /* '); // Prefix to encapsulate data in php code.
|
||||||
define('PHPSUFFIX',' */ ?>'); // Suffix to encapsulate data in php code.
|
define('PHPSUFFIX',' */ ?>'); // Suffix to encapsulate data in php code.
|
||||||
|
|
||||||
// Force cookie path (but do not change lifetime)
|
// Force cookie path (but do not change lifetime)
|
||||||
$cookie=session_get_cookie_params();
|
$cookie=session_get_cookie_params();
|
||||||
$cookiedir = ''; if(dirname($_SERVER['SCRIPT_NAME'])!='/') $cookiedir=dirname($_SERVER["SCRIPT_NAME"]).'/';
|
$cookiedir = ''; if(dirname($_SERVER['SCRIPT_NAME'])!='/') $cookiedir=dirname($_SERVER["SCRIPT_NAME"]).'/';
|
||||||
session_set_cookie_params($cookie['lifetime'],$cookiedir); // Set default cookie expiration and path.
|
session_set_cookie_params($cookie['lifetime'],$cookiedir,$_SERVER['SERVER_NAME']); // Set default cookie expiration and path.
|
||||||
|
|
||||||
// Set session parameters on server side.
|
// Set session parameters on server side.
|
||||||
define('INACTIVITY_TIMEOUT',3600); // (in seconds). If the user does not access any page within this time, his/her session is considered expired.
|
define('INACTIVITY_TIMEOUT',3600); // (in seconds). If the user does not access any page within this time, his/her session is considered expired.
|
||||||
|
@ -394,14 +394,14 @@ if (isset($_POST['login']))
|
||||||
$_SESSION['expires_on']=time()+$_SESSION['longlastingsession']; // Set session expiration on server-side.
|
$_SESSION['expires_on']=time()+$_SESSION['longlastingsession']; // Set session expiration on server-side.
|
||||||
|
|
||||||
$cookiedir = ''; if(dirname($_SERVER['SCRIPT_NAME'])!='/') $cookiedir=dirname($_SERVER["SCRIPT_NAME"]).'/';
|
$cookiedir = ''; if(dirname($_SERVER['SCRIPT_NAME'])!='/') $cookiedir=dirname($_SERVER["SCRIPT_NAME"]).'/';
|
||||||
session_set_cookie_params($_SESSION['longlastingsession'],$cookiedir); // Set session cookie expiration on client side
|
session_set_cookie_params($_SESSION['longlastingsession'],$cookiedir,$_SERVER['SERVER_NAME']); // Set session cookie expiration on client side
|
||||||
// Note: Never forget the trailing slash on the cookie path !
|
// Note: Never forget the trailing slash on the cookie path !
|
||||||
session_regenerate_id(true); // Send cookie with new expiration date to browser.
|
session_regenerate_id(true); // Send cookie with new expiration date to browser.
|
||||||
}
|
}
|
||||||
else // Standard session expiration (=when browser closes)
|
else // Standard session expiration (=when browser closes)
|
||||||
{
|
{
|
||||||
$cookiedir = ''; if(dirname($_SERVER['SCRIPT_NAME'])!='/') $cookiedir=dirname($_SERVER["SCRIPT_NAME"]).'/';
|
$cookiedir = ''; if(dirname($_SERVER['SCRIPT_NAME'])!='/') $cookiedir=dirname($_SERVER["SCRIPT_NAME"]).'/';
|
||||||
session_set_cookie_params(0,$cookiedir); // 0 means "When browser closes"
|
session_set_cookie_params(0,$cookiedir,$_SERVER['SERVER_NAME']); // 0 means "When browser closes"
|
||||||
session_regenerate_id(true);
|
session_regenerate_id(true);
|
||||||
}
|
}
|
||||||
// Optional redirect after login:
|
// Optional redirect after login:
|
||||||
|
|
Reference in a new issue