+# Rewrite clean URLs onto real files
+<IfModule mod_rewrite.c>
Options +FollowSymlinks
<IfDefine APACHE2>
AcceptPathInfo On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L]
+</IfModule>
if (($root != '/') && (substr($root, -1, 1) != '/')) {
$root .= '/';
}
+ $path = $root;
$root = 'http://'. $_SERVER['HTTP_HOST'] . $root;
}
$tplvars = array();
if (isset($_GET['action'])){
if ($_GET['action'] == "logout") {
- $userservice->logout();
+ $userservice->logout($path);
$tplvars['msg'] = T_('You have now logged out');
}
}
$login = false;
if (isset($_POST['submitted']) && isset($_POST['username']) && isset($_POST['password'])) {
$posteduser = trim(utf8_strtolower($_POST['username']));
- $login = $userservice->login($posteduser, $_POST['password'], ($_POST['keeppass'] == "yes"));
+ $login = $userservice->login($posteduser, $_POST['password'], ($_POST['keeppass'] == 'yes'), $path);
if ($login) {
if ($_POST['query'])
header('Location: '. createURL('bookmarks', $posteduser .'?'. $_POST['query']));
-Scuttle 0.7.3
+Scuttle 0.7.4
http://sourceforge.net/projects/scuttle/
http://scuttle.org/
* Edit config.inc.php.example and save the changes as a new config.inc.php file in the same directory.
-* Set the CHMOD permissions on the /cache/ subdirectory to 777
-
-=============
-PROJECT LINKS
-=============
-
-Scuttle Project:
-http://sourceforge.net/projects/scuttle/
\ No newline at end of file
+* Set the CHMOD permissions on the /cache/ subdirectory to 777
\ No newline at end of file
***************************************************************************/
require_once('header.inc.php');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
+$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
$tplVars = array();
border: 0;
}
body {
+ background-color: #FFF;
margin: 0;
padding: 0;
}
$updates = array('bModified' => $moddatetime, 'bTitle' => $title, 'bAddress' => $address, 'bDescription' => $description, 'bStatus' => $status, 'bHash' => md5($address));
if (!is_null($date)) {
- $datetime = gmdate('Y-m-d H:i:s', strtotime($date));
- $updates[] = array('bDateTime' => $datetime);
+ $updates['bDateTime'] = gmdate('Y-m-d H:i:s', strtotime($date));
}
$sql = 'UPDATE '. $GLOBALS['tableprefix'] .'bookmarks SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE bId = '. intval($bId);
}
function _randompassword() {
- $seed = (integer) md5(microtime());
- mt_srand($seed);
$password = mt_rand(1, 99999999);
$password = substr(md5($password), mt_rand(0, 19), mt_rand(6, 12));
return $password;
return false;
}
- function login($username, $password, $remember = FALSE) {
+ function login($username, $password, $remember = FALSE, $path = '/') {
$password = $this->sanitisePassword($password);
$query = 'SELECT '. $this->getFieldName('primary') .' FROM '. $this->getTableName() .' WHERE '. $this->getFieldName('username') .' = "'. $this->db->sql_escape($username) .'" AND '. $this->getFieldName('password') .' = "'. $this->db->sql_escape($password) .'"';
$id = $_SESSION[$this->getSessionKey()] = $row[$this->getFieldName('primary')];
if ($remember) {
$cookie = $id .':'. md5($username.$password);
- setcookie($this->cookiekey, $cookie, time() + $this->cookietime);
+ setcookie($this->cookiekey, $cookie, time() + $this->cookietime, $path);
}
return true;
} else {
}
}
- function logout() {
- @setcookie($this->cookiekey, NULL, time() - 1);
+ function logout($path = '/') {
+ @setcookie($this->cookiekey, NULL, time() - 1, $path);
unset($_COOKIE[$this->cookiekey]);
session_unset();
$this->getCurrentUser(TRUE, false);
}
function isValidEmail($email) {
- if (eregi("^((?:(?:(?:\w[\.\-\+_]?)*)\w)+)\@((?:(?:(?:\w[\.\-_]?){0,62})\w)+)\.(\w{2,6})$", $email)) {
+ if (preg_match("/^((?:(?:(?:\w[\.\-\+_]?)*)\w)+)\@((?:(?:(?:\w[\.\-_]?){0,62})\w)+)\.(\w{2,6})$/i", $email) > 0) {
list($emailUser, $emailDomain) = split("@", $email);
// Check if the email domain has a DNS record