]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'fabrixxm-master'
authorFriendika <info@friendika.com>
Tue, 24 May 2011 01:17:02 +0000 (18:17 -0700)
committerFriendika <info@friendika.com>
Tue, 24 May 2011 01:17:02 +0000 (18:17 -0700)
Conflicts:
boot.php

1  2 
boot.php
include/auth.php
index.php
mod/openid.php

diff --combined boot.php
index 48d0d79ad61f99914ec441fed59f25b8662c9f1c,acb49ca934f55c92b15f86299671cc3c871887aa..12fd96e7771569ab0b0557ff103676a2bafc6dfb
+++ b/boot.php
@@@ -4,7 -4,7 +4,7 @@@ set_time_limit(0)
  ini_set('pcre.backtrack_limit', 250000);
  
  
 -define ( 'FRIENDIKA_VERSION',      '2.2.988' );
 +define ( 'FRIENDIKA_VERSION',      '2.2.989' );
  define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
  define ( 'DB_UPDATE_VERSION',      1054      );
  
@@@ -1007,6 -1007,13 +1007,13 @@@ function notice($s) 
        if($a->interactive)
                $_SESSION['sysmsg'] .= $s;
  }}
+ if(! function_exists('info')) {
+ function info($s) {
+       $a = get_app();
+       if($a->interactive)
+               $_SESSION['sysmsg_info'] .= $s;
+ }}
  
  // wrapper around config to limit the text length of an incoming message
  
@@@ -2707,8 -2714,6 +2714,8 @@@ function unamp($s) 
  }}
  
  
 +
 +
  if(! function_exists('lang_selector')) {
  function lang_selector() {
        global $lang;
@@@ -2751,4 -2756,3 +2758,4 @@@ function is_site_admin() 
                return true;
        return false;
  }}
 +
diff --combined include/auth.php
index 382d2c65877da5e1f82710a9e16cf4192217c4d5,67e21d988936dbe94cd25e9ecf400da50c670f70..fd80a63e221a553e6b484ec19c84e99e61297af3
@@@ -24,7 -24,7 +24,7 @@@ if((isset($_SESSION)) && (x($_SESSION,'
                // process logout request
  
                nuke_session();
-               notice( t('Logged out.') . EOL);
+               info( t('Logged out.') . EOL);
                goaway($a->get_baseurl());
        }
  
@@@ -205,11 -205,11 +205,11 @@@ else 
                if($a->user['login_date'] === '0000-00-00 00:00:00') {
                        $_SESSION['return_url'] = 'profile_photo/new';
                        $a->module = 'profile_photo';
-                       notice( t("Welcome ") . $a->user['username'] . EOL);
-                       notice( t('Please upload a profile photo.') . EOL);
+                       info( t("Welcome ") . $a->user['username'] . EOL);
+                       info( t('Please upload a profile photo.') . EOL);
                }
                else
-                       notice( t("Welcome back ") . $a->user['username'] . EOL);
+                       info( t("Welcome back ") . $a->user['username'] . EOL);
  
                if(strlen($a->user['timezone'])) {
                        date_default_timezone_set($a->user['timezone']);
                        $_SESSION['cid'] = $a->cid;
                }
  
 +              $l = get_language();
  
 -              q("UPDATE `user` SET `login_date` = '%s' WHERE `uid` = %d LIMIT 1",
 +              q("UPDATE `user` SET `login_date` = '%s', `language` = '%s' WHERE `uid` = %d LIMIT 1",
                        dbesc(datetime_convert()),
 +                      dbesc($l),
                        intval($_SESSION['uid'])
                );
  
diff --combined index.php
index eb75585c48d909b63838cff51cf113eae44445b8,dc149436c16564c1a2cf7b6ad40ab821295da825..534cb93f7cf4ee38148030f55fefac6aa42878cc
+++ b/index.php
@@@ -29,8 -29,22 +29,8 @@@ $install = ((file_exists('.htconfig.php
  
  @include(".htconfig.php");
  
 -/**
 - *
 - * Get the language setting directly from system variables, bypassing get_config()
 - * as database may not yet be configured.
 - * 
 - * If possible, we use the value from the browser.
 - *
 - */
 -
 -if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
 -      $langs = preg_split("/[,-]/",$_SERVER['HTTP_ACCEPT_LANGUAGE'],2);
 -      $lang = $langs[0];
 -} else {
 -      $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
 -}
  
 +$lang = get_language();
        
  load_translation_table($lang);
  
@@@ -110,6 -124,9 +110,9 @@@ if(! x($_SESSION,'authenticated')
  if(! x($_SESSION,'sysmsg'))
        $_SESSION['sysmsg'] = '';
  
+ if(! x($_SESSION,'sysmsg_info'))
+       $_SESSION['sysmsg_info'] = '';
  /*
   * check_config() is responsible for running update scripts. These automatically 
   * update the DB schema whenever we push a new one out. It also checks to see if
@@@ -262,8 -279,16 +265,16 @@@ if(stristr($_SESSION['sysmsg'], t('Perm
  if(x($_SESSION,'sysmsg')) {
        $a->page['content'] = "<div id=\"sysmsg\" class=\"error-message\">{$_SESSION['sysmsg']}</div>\r\n"
                . ((x($a->page,'content')) ? $a->page['content'] : '');
+       $_SESSION['sysmsg']="";
        unset($_SESSION['sysmsg']);
  }
+ if(x($_SESSION,'sysmsg_info')) {
+       $a->page['content'] = "<div id=\"sysmsg_info\" class=\"info-message\">{$_SESSION['sysmsg_info']}</div>\r\n"
+               . ((x($a->page,'content')) ? $a->page['content'] : '');
+       $_SESSION['sysmsg_info']="";
+       unset($_SESSION['sysmsg_info']);
+ }
  
  
  call_hooks('page_end', $a->page['content']);
diff --combined mod/openid.php
index 7bf8c299c8c76a5aaff49f7ea27976ad87ad6451,a1824fb38a0c1b3673b2ea172195a00a28f2b315..537d84ce3891d9b283ecc6e1f21cd2af152acdab
@@@ -75,11 -75,11 +75,11 @@@ function openid_content(&$a) 
                        if($a->user['login_date'] === '0000-00-00 00:00:00') {
                                $_SESSION['return_url'] = 'profile_photo/new';
                                $a->module = 'profile_photo';
-                               notice( t("Welcome ") . $a->user['username'] . EOL);
-                               notice( t('Please upload a profile photo.') . EOL);
+                               info( t("Welcome ") . $a->user['username'] . EOL);
+                               info( t('Please upload a profile photo.') . EOL);
                        }
                        else
-                               notice( t("Welcome back ") . $a->user['username'] . EOL);
+                               info( t("Welcome back ") . $a->user['username'] . EOL);
  
  
                        if(strlen($a->user['timezone'])) {
                                $_SESSION['cid'] = $a->cid;
                        }
  
 -                      q("UPDATE `user` SET `login_date` = '%s' WHERE `uid` = %d LIMIT 1",
 +                      $l = get_language();
 +
 +                      q("UPDATE `user` SET `login_date` = '%s', `language` = '%s' WHERE `uid` = %d LIMIT 1",
                                dbesc(datetime_convert()),
 +                              dbesc($l),
                                intval($_SESSION['uid'])
                        );
  
 +
                        header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] .'"');
                        if(($a->module !== 'home') && isset($_SESSION['return_url']))
                                goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
        notice( t('Login failed.') . EOL);
        goaway($a->get_baseurl());
        // NOTREACHED
- }
+ }