[Jaws-commits] r13389 - branches/0.8/html/include/Jaws

afz at jaws-project.com afz at jaws-project.com
Sat Aug 11 22:11:04 UTC 2012


Author: afz
Date: 2012-08-11 22:11:04 +0000 (Sat, 11 Aug 2012)
New Revision: 13389

Modified:
   branches/0.8/html/include/Jaws/User.php
Log:
change avatar of current user on the top of control panel

Modified: branches/0.8/html/include/Jaws/User.php
===================================================================
--- branches/0.8/html/include/Jaws/User.php	2012-08-11 21:39:32 UTC (rev 13388)
+++ branches/0.8/html/include/Jaws/User.php	2012-08-11 22:11:04 UTC (rev 13389)
@@ -272,7 +272,7 @@
     function GetAvatar($avatar, $email)
     {
         $avatar = $GLOBALS['app']->getDataURL(). "avatar/$avatar";
-        if (!file_exists($avatar)) {
+        if (empty($avatar) || !file_exists($avatar)) {
             require_once JAWS_PATH . 'include/Jaws/Gravatar.php';
             $avatar = Jaws_Gravatar::GetGravatar($email);
         }
@@ -873,7 +873,11 @@
 
             if (isset($GLOBALS['app']->Session) && $GLOBALS['app']->Session->GetAttribute('user') == $id) {
                 foreach($params as $k => $v) {
-                    $GLOBALS['app']->Session->SetAttribute($k, $v);
+                    if ($k == 'avatar') {
+                        $GLOBALS['app']->Session->SetAttribute($k, $this->GetAvatar($v, $user['email']));
+                    } else {
+                        $GLOBALS['app']->Session->SetAttribute($k, $v);
+                    }
                 }
             }
         }



More information about the Jaws-commits mailing list