Merge branch '0.9.x' into inblob
This commit is contained in:
commit
f05ae1f210
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/**
|
||||||
* StatusNet - the distributed open-source microblogging tool
|
* StatusNet - the distributed open-source microblogging tool
|
||||||
* Copyright (C) 2009, StatusNet, Inc.
|
* Copyright (C) 2009-2010 StatusNet, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
@ -15,9 +15,12 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
global $config, $_server, $_path;
|
global $config, $_server, $_path;
|
||||||
|
|
||||||
|
@ -236,10 +239,10 @@ class StatusNet
|
||||||
$config_files = array($conffile);
|
$config_files = array($conffile);
|
||||||
} else {
|
} else {
|
||||||
$config_files = array('/etc/statusnet/statusnet.php',
|
$config_files = array('/etc/statusnet/statusnet.php',
|
||||||
'/etc/statusnet/laconica.php',
|
'/etc/statusnet/laconica.php',
|
||||||
'/etc/laconica/laconica.php',
|
'/etc/laconica/laconica.php',
|
||||||
'/etc/statusnet/'.$_server.'.php',
|
'/etc/statusnet/'.$_server.'.php',
|
||||||
'/etc/laconica/'.$_server.'.php');
|
'/etc/laconica/'.$_server.'.php');
|
||||||
|
|
||||||
if (strlen($_path) > 0) {
|
if (strlen($_path) > 0) {
|
||||||
$config_files[] = '/etc/statusnet/'.$_server.'_'.$_path.'.php';
|
$config_files[] = '/etc/statusnet/'.$_server.'_'.$_path.'.php';
|
||||||
|
@ -260,7 +263,7 @@ class StatusNet
|
||||||
|
|
||||||
if (!self::$have_config) {
|
if (!self::$have_config) {
|
||||||
throw new NoConfigException("No configuration file found.",
|
throw new NoConfigException("No configuration file found.",
|
||||||
$config_files);
|
$config_files);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fixup for statusnet.ini
|
// Fixup for statusnet.ini
|
||||||
|
|
|
@ -191,7 +191,6 @@ function common_ensure_session()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
common_debug("Session ID = " . session_id());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Three kinds of arguments:
|
// Three kinds of arguments:
|
||||||
|
@ -258,7 +257,6 @@ function common_rememberme($user=null)
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
common_debug('No current user to remember', __FILE__);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,14 +274,11 @@ function common_rememberme($user=null)
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($rm, 'INSERT', __FILE__);
|
common_log_db_error($rm, 'INSERT', __FILE__);
|
||||||
common_debug('Error adding rememberme record for ' . $user->nickname, __FILE__);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rm->query('COMMIT');
|
$rm->query('COMMIT');
|
||||||
|
|
||||||
common_debug('Inserted rememberme record (' . $rm->code . ', ' . $rm->user_id . '); result = ' . $result . '.', __FILE__);
|
|
||||||
|
|
||||||
$cookieval = $rm->user_id . ':' . $rm->code;
|
$cookieval = $rm->user_id . ':' . $rm->code;
|
||||||
|
|
||||||
common_log(LOG_INFO, 'adding rememberme cookie "' . $cookieval . '" for ' . $user->nickname);
|
common_log(LOG_INFO, 'adding rememberme cookie "' . $cookieval . '" for ' . $user->nickname);
|
||||||
|
@ -391,8 +386,6 @@ function common_current_user()
|
||||||
$_cur = common_remembered_user();
|
$_cur = common_remembered_user();
|
||||||
|
|
||||||
if ($_cur) {
|
if ($_cur) {
|
||||||
common_debug("Got User " . $_cur->nickname);
|
|
||||||
common_debug("Faking session on remembered user");
|
|
||||||
// XXX: Is this necessary?
|
// XXX: Is this necessary?
|
||||||
$_SESSION['userid'] = $_cur->id;
|
$_SESSION['userid'] = $_cur->id;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user