aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-28 14:12:53 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-28 14:12:53 -0400
commit55b587002ea7e892d20010800f5892949f56d34a (patch)
tree6d18c9e255a3869d3636e628bec68123b4191ae0 /boot.php
parent819683a073f85b05807d6c936a2b746296fc8de4 (diff)
parentac4688eac087854bf8cb0c893d7a79052ad63a20 (diff)
downloadvolse-hubzilla-55b587002ea7e892d20010800f5892949f56d34a.tar.gz
volse-hubzilla-55b587002ea7e892d20010800f5892949f56d34a.tar.bz2
volse-hubzilla-55b587002ea7e892d20010800f5892949f56d34a.zip
Merge remote-tracking branch 'upstream/dev' into wiki
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php43
1 files changed, 30 insertions, 13 deletions
diff --git a/boot.php b/boot.php
index a84ee256c..5881ac6b3 100755
--- a/boot.php
+++ b/boot.php
@@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '1.7.1' );
define ( 'ZOT_REVISION', 1.1 );
-define ( 'DB_UPDATE_VERSION', 1168 );
+define ( 'DB_UPDATE_VERSION', 1169 );
/**
@@ -692,7 +692,7 @@ function startup() {
class ZotlabsAutoloader {
static public function loader($className) {
$filename = str_replace('\\', '/', $className) . ".php";
- if (file_exists($filename)) {
+ if(file_exists($filename)) {
include($filename);
if (class_exists($className)) {
return TRUE;
@@ -703,7 +703,7 @@ class ZotlabsAutoloader {
if(! $arr[0])
$arr = array_shift($arr);
$filename = 'addon/' . lcfirst($arr[0]) . '/' . $arr[1] . ((count($arr) === 2) ? '.php' : '/' . $arr[2] . ".php");
- if (file_exists($filename)) {
+ if(file_exists($filename)) {
include($filename);
if (class_exists($className)) {
return TRUE;
@@ -1769,7 +1769,9 @@ function get_account_id() {
* @return int|bool channel_id or false
*/
function local_channel() {
- if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'uid')))
+ if(session_id()
+ && array_key_exists('authenticated',$_SESSION) && $_SESSION['authenticated']
+ && array_key_exists('uid',$_SESSION) && intval($_SESSION['uid']))
return intval($_SESSION['uid']);
return false;
@@ -1800,7 +1802,9 @@ function local_user() {
* @return string|bool visitor_id or false
*/
function remote_channel() {
- if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'visitor_id')))
+ if(session_id()
+ && array_key_exists('authenticated',$_SESSION) && $_SESSION['authenticated']
+ && array_key_exists('visitor_id',$_SESSION) && intval($_SESSION['visitor_id']))
return $_SESSION['visitor_id'];
return false;
@@ -1825,6 +1829,9 @@ function remote_user() {
* @param string $s Text to display
*/
function notice($s) {
+ if(! session_id())
+ return;
+
if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array();
// ignore duplicated error messages which haven't yet been displayed
@@ -1848,7 +1855,10 @@ function notice($s) {
* @param string $s Text to display
*/
function info($s) {
- if(! x($_SESSION, 'sysmsg_info')) $_SESSION['sysmsg_info'] = array();
+ if(! session_id())
+ return;
+ if(! x($_SESSION, 'sysmsg_info'))
+ $_SESSION['sysmsg_info'] = array();
if(App::$interactive)
$_SESSION['sysmsg_info'][] = $s;
}
@@ -1934,6 +1944,10 @@ function proc_run(){
* @brief Checks if we are running on M$ Windows.
*
* @return bool true if we run on M$ Windows
+ *
+ * It's possible you might be able to run on WAMP or XAMPP, and this
+ * has been accomplished, but is not officially supported. Good luck.
+ *
*/
function is_windows() {
return ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false);
@@ -1949,6 +1963,9 @@ function is_windows() {
function is_site_admin() {
+ if(! session_id())
+ return false;
+
if($_SESSION['delegate'])
return false;
@@ -1969,6 +1986,9 @@ function is_site_admin() {
*/
function is_developer() {
+ if(! session_id())
+ return false;
+
if((intval($_SESSION['authenticated']))
&& (is_array(App::$account))
&& (App::$account['account_roles'] & ACCOUNT_ROLE_DEVELOPER))
@@ -1987,7 +2007,7 @@ function load_contact_links($uid) {
// logger('load_contact_links');
- $r = q("SELECT abook_id, abook_flags, abook_my_perms, abook_their_perms, xchan_hash, xchan_photo_m, xchan_name, xchan_url from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d ",
+ $r = q("SELECT abook_id, abook_flags, abook_my_perms, abook_their_perms, xchan_hash, xchan_photo_m, xchan_name, xchan_url, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d ",
intval($uid)
);
if($r) {
@@ -2010,6 +2030,7 @@ function load_contact_links($uid) {
*
* @return string
*/
+
function build_querystring($params, $name = null) {
$ret = '';
foreach($params as $key => $val) {
@@ -2052,8 +2073,9 @@ function dba_timer() {
/**
* @brief Returns xchan_hash from the observer.
*
- * @return string Empty if no observer, otherwise xchan_hash from observer
+ * @return empty string if no observer, otherwise xchan_hash from observer
*/
+
function get_observer_hash() {
$observer = App::get_observer();
if(is_array($observer))
@@ -2110,8 +2132,6 @@ function load_pdl(&$a) {
App::$comanche = new Zotlabs\Render\Comanche();
- // require_once('include/comanche.php');
-
if (! count(App::$layout)) {
$arr = array('module' => App::$module, 'layout' => '');
@@ -2132,13 +2152,10 @@ function load_pdl(&$a) {
App::$pdl = $s;
}
}
-
}
function exec_pdl(&$a) {
-// require_once('include/comanche.php');
-
if(App::$pdl) {
App::$comanche->parse(App::$pdl,1);
}