]> git.mxchange.org Git - friendica.git/commitdiff
switch identities to manage pages
authorFriendika <info@friendika.com>
Wed, 2 Mar 2011 04:18:47 +0000 (20:18 -0800)
committerFriendika <info@friendika.com>
Wed, 2 Mar 2011 04:18:47 +0000 (20:18 -0800)
boot.php
include/auth.php
include/nav.php
mod/openid.php
view/theme/duepuntozero/style.css
view/theme/loozah/style.css

index 06cf5b7605e1cad34a6be08839520059803f7551..3cf01b4a0d6b7ed56f5e3ffb0efcbb86ac50cb43 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -197,6 +197,7 @@ class App {
        public  $interactive = true;
        public  $plugins;
        public  $apps;
+       public  $identities;
 
        private $scheme;
        private $hostname;
index a0244571b3fec5703c99a7d5832cc2c51f1f374e..e8cee3918c5d368938c2fd94d2014e1f63dec4b4 100644 (file)
@@ -61,6 +61,13 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p
 
                $_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
 
+               $r = q("SELECT `uid`,`username` FROM `user` WHERE `password` = '%s' AND `email` = '%s'",
+                       dbesc($a->user['password']),
+                       dbesc($a->user['email'])
+               );
+               if(count($r))
+                       $a->identities = $r;
+
                $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
                        intval($_SESSION['uid']));
                if(count($r)) {
@@ -192,7 +199,15 @@ else {
                        $a->timezone = $a->user['timezone'];
                }
 
-               $r = q("SELECT * FROM `contact` WHERE `uid` = %s AND `self` = 1 LIMIT 1",
+               $r = q("SELECT `uid`,`username` FROM `user` WHERE `password` = '%s' AND `email` = '%s'",
+                       dbesc($a->user['password']),
+                       dbesc($a->user['email'])
+               );
+               if(count($r))
+                       $a->identities = $r;
+
+
+               $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
                        intval($_SESSION['uid']));
                if(count($r)) {
                        $a->contact = $r[0];
index bfbc10f5a71a70ae71da0f20cacd5818dd8b891c..043cf0f7fa40138b118eea5da6d396583cd7f858 100644 (file)
@@ -25,7 +25,9 @@ function nav(&$a) {
         *
         */
 
-       $a->page['nav'] .= '<div id="site-location">' . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ) . '</div>';
+       $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
+               
+       $a->page['nav'] .= '<div id="site-location">' . $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ) . '</div>';
 
 
        /**
@@ -98,6 +100,9 @@ function nav(&$a) {
                $a->page['nav'] .= '<a id="nav-messages-link" class="nav-commlink" href="message">' . t('Messages') 
                        . '</a><span id="mail-update" class="nav-ajax-left"></span>' . "\r\n";
                
+               if(is_array($a->identities) && count($a->identities) > 1) {
+                       $a->page['nav'] .= '<a id="nav-manage-link" class="nav-commlink" href="manage">' . t('Manage') . '</a>' . "\r\n"; 
+               }
 
                $a->page['nav'] .= '<a id="nav-settings-link" class="nav-link" href="settings">' . t('Settings') . "</a>\r\n";
 
index 2e1025692d3a8285eff137a2fc0a7d8589700904..6ccd28e5b62831ef30a81991b8ba8f99b4297114 100644 (file)
@@ -78,8 +78,16 @@ function openid_content(&$a) {
                                $a->timezone = $a->user['timezone'];
                        }
 
-                       $r = q("SELECT * FROM `contact` WHERE `uid` = %s AND `self` = 1 LIMIT 1",
-                               intval($_SESSION['uid']));
+                       $r = q("SELECT `uid`,`username` FROM `user` WHERE `password` = '%s' AND `email` = '%s'",
+                               dbesc($a->user['password']),
+                               dbesc($a->user['email'])
+                       );
+                       if(count($r))
+                               $a->identities = $r;
+
+                       $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
+                               intval($_SESSION['uid'])
+                       );
                        if(count($r)) {
                                $a->contact = $r[0];
                                $a->cid = $r[0]['id'];
index 3877fb2ea6b8ef085865eadb213acc5ac013e98d..158649933877bdb12c4b585950f01c6e038e3d02 100644 (file)
@@ -2040,3 +2040,16 @@ a.mail-list-link {
        margin: 10px;
 }
 
+#identity-manage-desc {
+       margin-top:15px;
+       margin-bottom: 15px;
+}
+
+#identity-manage-choose {
+       margin-bottom: 15px;
+}
+
+#identity-submit {
+       margin-top: 20px;
+}
+
index 7e8299eb564dd2dce238b23589a727c61e712f06..902e71be8fc86d2fa6394dac45154537e3c95a69 100644 (file)
@@ -2086,3 +2086,17 @@ a.mail-list-link {
        margin: 10px;
 }
 
+
+#identity-manage-desc {
+       margin-top:15px;
+       margin-bottom: 15px;
+}
+
+#identity-manage-choose {
+       margin-bottom: 15px;
+}
+
+#identity-submit {
+       margin-top: 20px;
+}
+