various issues from the forums
This commit is contained in:
@@ -2106,10 +2106,10 @@ require_once('include/api_auth.php');
|
||||
'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl,
|
||||
'shorturllength' => '30',
|
||||
'hubzilla' => array(
|
||||
'PLATFORM_NAME' => PLATFORM_NAME,
|
||||
'RED_VERSION' => RED_VERSION,
|
||||
'PLATFORM_NAME' => get_platform_name(),
|
||||
'RED_VERSION' => get_project_version(),
|
||||
'ZOT_REVISION' => ZOT_REVISION,
|
||||
'DB_UPDATE_VERSION' => DB_UPDATE_VERSION
|
||||
'DB_UPDATE_VERSION' => get_update_version()
|
||||
)
|
||||
));
|
||||
|
||||
@@ -2142,12 +2142,12 @@ require_once('include/api_auth.php');
|
||||
|
||||
if($type === 'xml') {
|
||||
header("Content-type: application/xml");
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n" . '<version>' . RED_VERSION . '</version>' . "\r\n";
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n" . '<version>' . get_project_version() . '</version>' . "\r\n";
|
||||
killme();
|
||||
}
|
||||
elseif($type === 'json') {
|
||||
header("Content-type: application/json");
|
||||
echo '"' . RED_VERSION . '"';
|
||||
echo '"' . get_project_version() . '"';
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ function ical_wrapper($ev) {
|
||||
$o .= "BEGIN:VCALENDAR";
|
||||
$o .= "\r\nVERSION:2.0";
|
||||
$o .= "\r\nMETHOD:PUBLISH";
|
||||
$o .= "\r\nPRODID:-//" . get_config('system','sitename') . "//" . PLATFORM_NAME . "//" . strtoupper(get_app()->language). "\r\n";
|
||||
$o .= "\r\nPRODID:-//" . get_config('system','sitename') . "//" . get_platform_name() . "//" . strtoupper(get_app()->language). "\r\n";
|
||||
if(array_key_exists('start', $ev))
|
||||
$o .= format_event_ical($ev);
|
||||
else {
|
||||
|
||||
@@ -482,6 +482,8 @@ function identity_basic_export($channel_id, $items = false) {
|
||||
|
||||
$ret = array();
|
||||
|
||||
// use constants here as otherwise we will have no idea if we can import from a site
|
||||
// with a non-standard platform and version.
|
||||
$ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION);
|
||||
|
||||
$r = q("select * from channel where channel_id = %d limit 1",
|
||||
|
||||
@@ -604,8 +604,8 @@ function get_feed_for($channel, $observer_hash, $params) {
|
||||
$atom = '';
|
||||
|
||||
$atom .= replace_macros($feed_template, array(
|
||||
'$version' => xmlify(RED_VERSION),
|
||||
'$red' => xmlify(PLATFORM_NAME),
|
||||
'$version' => xmlify(get_project_version()),
|
||||
'$red' => xmlify(get_platform_name()),
|
||||
'$feed_id' => xmlify($channel['xchan_url']),
|
||||
'$feed_title' => xmlify($channel['channel_name']),
|
||||
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now' , ATOM_TIME)) ,
|
||||
|
||||
@@ -182,7 +182,7 @@ function t($s, $ctx = '') {
|
||||
|
||||
function translate_projectname($s) {
|
||||
|
||||
return str_replace(array('$projectname','$Projectname'),array(PLATFORM_NAME,ucfirst(PLATFORM_NAME)),$s);
|
||||
return str_replace(array('$projectname','$Projectname'),array(get_platform_name(),ucfirst(get_platform_name())),$s);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1767,16 +1767,13 @@ function get_site_info() {
|
||||
$site_info = get_config('system','info');
|
||||
$site_name = get_config('system','sitename');
|
||||
if(! get_config('system','hidden_version_siteinfo')) {
|
||||
$version = RED_VERSION;
|
||||
$version = get_project_version();
|
||||
$tag = get_std_version();
|
||||
|
||||
if(@is_dir('.git') && function_exists('shell_exec')) {
|
||||
$commit = trim( @shell_exec('git log -1 --format="%h"'));
|
||||
// if(! get_config('system','hidden_tag_siteinfo'))
|
||||
// $tag = trim( @shell_exec('git describe --tags --abbrev=0'));
|
||||
// else
|
||||
// $tag = '';
|
||||
}
|
||||
|
||||
if(! isset($commit) || strlen($commit) > 16)
|
||||
$commit = '';
|
||||
}
|
||||
@@ -1820,7 +1817,7 @@ function get_site_info() {
|
||||
'locked_features' => $locked_features,
|
||||
'admin' => $admin,
|
||||
'site_name' => (($site_name) ? $site_name : ''),
|
||||
'platform' => PLATFORM_NAME,
|
||||
'platform' => get_platform_name(),
|
||||
'dbdriver' => $db->getdriver(),
|
||||
'lastpoll' => get_config('system','lastpoll'),
|
||||
'info' => (($site_info) ? $site_info : ''),
|
||||
|
||||
@@ -18,20 +18,13 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||
|
||||
$_SESSION['addr'] = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
$lastlog_updated = false;
|
||||
|
||||
if(x($user_record, 'account_id')) {
|
||||
$a->account = $user_record;
|
||||
$_SESSION['account_id'] = $user_record['account_id'];
|
||||
$_SESSION['authenticated'] = 1;
|
||||
|
||||
if($login_initial || $update_lastlog) {
|
||||
q("update account set account_lastlog = '%s' where account_id = %d",
|
||||
dbesc(datetime_convert()),
|
||||
intval($_SESSION['account_id'])
|
||||
);
|
||||
$a->account['account_lastlog'] = datetime_convert();
|
||||
call_hooks('logged_in', $a->account);
|
||||
|
||||
}
|
||||
|
||||
$uid_to_load = (((x($_SESSION,'uid')) && (intval($_SESSION['uid'])))
|
||||
? intval($_SESSION['uid'])
|
||||
@@ -42,9 +35,19 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||
change_channel($uid_to_load);
|
||||
}
|
||||
|
||||
if($login_initial || $update_lastlog) {
|
||||
q("update account set account_lastlog = '%s' where account_id = %d",
|
||||
dbesc(datetime_convert()),
|
||||
intval($_SESSION['account_id'])
|
||||
);
|
||||
$a->account['account_lastlog'] = datetime_convert();
|
||||
$lastlog_updated = true;
|
||||
call_hooks('logged_in', $a->account);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($login_initial) {
|
||||
if(($login_initial) && (! $lastlog_updated)) {
|
||||
|
||||
call_hooks('logged_in', $user_record);
|
||||
|
||||
|
||||
@@ -3828,7 +3828,7 @@ function zotinfo($arr) {
|
||||
$ret['site']['channels'] = channel_total();
|
||||
|
||||
|
||||
$ret['site']['version'] = PLATFORM_NAME . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']';
|
||||
$ret['site']['version'] = get_platform_name() . ' ' . RED_VERSION . '[' . DB_UPDATE_VERSION . ']';
|
||||
|
||||
$ret['site']['admin'] = get_config('system','admin_email');
|
||||
|
||||
@@ -3848,7 +3848,7 @@ function zotinfo($arr) {
|
||||
$ret['site']['sellpage'] = get_config('system','sellpage');
|
||||
$ret['site']['location'] = get_config('system','site_location');
|
||||
$ret['site']['realm'] = get_directory_realm();
|
||||
$ret['site']['project'] = PLATFORM_NAME;
|
||||
$ret['site']['project'] = get_platform_name();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user