]> git.mxchange.org Git - friendica.git/commitdiff
eradicate redundant get_uid function
authorMike Macgirvin <mike@macgirvin.com>
Mon, 18 Oct 2010 21:34:59 +0000 (14:34 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Mon, 18 Oct 2010 21:34:59 +0000 (14:34 -0700)
18 files changed:
boot.php
include/Contact.php
include/security.php
mod/contacts.php
mod/dfrn_confirm.php
mod/dfrn_request.php
mod/display.php
mod/group.php
mod/like.php
mod/network.php
mod/notifications.php
mod/photos.php
mod/ping.php
mod/profile.php
mod/profile_photo.php
mod/redir.php
mod/settings.php
mod/wall_upload.php

index 786ebdee68a0595215b5189863c632fd98e4ecd2..b3d116a50a0e72ec57d861d4e6feaebd0adcbbf7 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1023,13 +1023,6 @@ function photo_new_resource() {
 }}
 
 
-// Returns logged in user ID
-
-if(! function_exists('get_uid')) {
-function get_uid() {
-       return local_user();
-}}
-
 // Take a URL from the wild, prepend http:// if necessary
 // and check DNS to see if it's real
 // return true if it's OK, false if something is wrong with it
index a915ae0b444883045097ccfb6d8a8e91e9c64b48..a514a119caae9b5115b6ce40366dcc787ea172b6 100644 (file)
@@ -16,7 +16,7 @@ function user_remove($uid) {
        q("DELETE FROM `profile` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `profile_check` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `user` WHERE `uid` = %d", intval($uid));
-       if($uid == get_uid()) {
+       if($uid == local_user()) {
                unset($_SESSION['authenticated']);
                unset($_SESSION['uid']);
                killme();
index 2ff26ff74eafee39b100cf38392caf7eb0f73110..794cd2ce1f36d732d974b5478cfdc61cc81854f4 100644 (file)
@@ -4,7 +4,7 @@ function can_write_wall(&$a,$owner) {
 
         if((! (local_user())) && (! (remote_user())))
                 return false;
-               $uid = get_uid();
+               $uid = local_user();
 
         if(($uid) && ($uid == $owner)) {
                 return true;
index dbad2a15867b9904d10841bdc27fb64fd2ace7ae..746331ea540ac255a634f1cb34770f449cf29e6b 100644 (file)
@@ -21,7 +21,7 @@ function contacts_post(&$a) {
 
        $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                intval($contact_id),
-               intval(get_uid())
+               intval(local_user())
        );
 
        if(! count($orig_record)) {
@@ -34,7 +34,7 @@ function contacts_post(&$a) {
        if($profile_id) {
                $r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($profile_id),
-                       intval(get_uid())
+                       intval(local_user())
                );
                if(! count($r)) {
                        notice( t('Could not locate selected profile.') . EOL);
@@ -62,7 +62,7 @@ function contacts_post(&$a) {
                intval($rating),
                dbesc($reason),
                intval($contact_id),
-               intval(get_uid())
+               intval(local_user())
        );
        if($r)
                notice( t('Contact updated.') . EOL);
@@ -92,7 +92,7 @@ function contacts_content(&$a) {
 
                $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($contact_id),
-                       intval(get_uid())
+                       intval(local_user())
                );
 
                if(! count($orig_record)) {
@@ -107,7 +107,7 @@ function contacts_content(&$a) {
                        $r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                        intval($blocked),
                                        intval($contact_id),
-                                       intval(get_uid())
+                                       intval(local_user())
                        );
                        if($r) {
                                notice( t('Contact has been ') . (($blocked) ? t('blocked') : t('unblocked')) . EOL );
@@ -121,7 +121,7 @@ function contacts_content(&$a) {
                        $r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                        intval($readonly),
                                        intval($contact_id),
-                                       intval(get_uid())
+                                       intval(local_user())
                        );
                        if($r) {
                                notice( t('Contact has been ') . (($readonly) ? t('ignored') : t('unignored')) . EOL );
@@ -142,7 +142,7 @@ function contacts_content(&$a) {
 
                $contact_id = intval($a->argv[1]);
                $r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1",
-                       intval(get_uid()),
+                       intval(local_user()),
                        intval($contact_id)
                );
                if(! count($r)) {
index 82e1b7624a2ebb66f901f5aaa7387d99d8d1c0f7..992947613f4681d6fc1c0e385378dfc0b844785a 100644 (file)
@@ -25,7 +25,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
 
        if(! x($_POST,'source_url')) {
                
-               $uid = ((is_array($handsfree)) ? $handsfree['uid'] : get_uid());
+               $uid = ((is_array($handsfree)) ? $handsfree['uid'] : local_user());
 
                if(! $uid) {
                        notice( t('Permission denied.') . EOL );
index 6821e1fd604b6ddd8be293939780b706d94968d1..0fbd164c0a23b44f209c4947c5fb72d411f50acb 100644 (file)
@@ -45,7 +45,7 @@ function dfrn_request_post(&$a) {
                        if(x($dfrn_url)) {
        
                                $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
-                                       intval(get_uid()),
+                                       intval(local_user()),
                                        dbesc($dfrn_url)
                                );
        
@@ -99,7 +99,7 @@ function dfrn_request_post(&$a) {
                                        $r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `name`, `photo`, `site-pubkey`,
                                                `request`, `confirm`, `notify`, `poll`, `aes_allow`) 
                                                VALUES ( %d, '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', %d)",
-                                               intval(get_uid()),
+                                               intval(local_user()),
                                                datetime_convert(),
                                                dbesc($dfrn_url),
                                                $parms['fn'],
index 2b721aef8ad944221f6b7fce203039417b73ceae..fefef8ad6b4952e2cc36e9c9d3dcfcc2831d9e39 100644 (file)
@@ -57,7 +57,7 @@ function display_content(&$a) {
 
        // Profile owner - everything is visible
 
-       if(local_user() && (get_uid() == $a->profile['uid'])) {
+       if(local_user() && (local_user() == $a->profile['uid'])) {
                $sql_extra = '';                
        }
 
@@ -149,7 +149,7 @@ function display_content(&$a) {
                        if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) 
                                continue;
 
-                       $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
+                       $lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
                                || strlen($item['deny_cid']) || strlen($item['deny_gid']))
                                ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
                                : '<div class="wall-item-lock"></div>');
@@ -222,7 +222,7 @@ function display_content(&$a) {
                        $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
                        $profile_link = $profile_url;
 
-                       if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid()))
+                       if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == local_user()))
                                $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id']));
                        else 
                                $drop = replace_macros(load_view_file('view/wall_fake_drop.tpl'), array('$id' => $item['id']));
index 56c3e21d1e0ae372598a9cfeb849a194c3423b27..e5c6b92aea61c7643897812851c10fdc6dcd3a60 100644 (file)
@@ -22,10 +22,10 @@ function group_post(&$a) {
 
        if(($a->argc == 2) && ($a->argv[1] === 'new')) {
                $name = notags(trim($_POST['groupname']));
-               $r = group_add(get_uid(),$name);
+               $r = group_add(local_user(),$name);
                if($r) {
                        notice( t('Group created.') . EOL );
-                       $r = group_byname(get_uid(),$name);
+                       $r = group_byname(local_user(),$name);
                        if($r)
                                goaway($a->get_baseurl() . '/group/' . $r);
                }
@@ -37,7 +37,7 @@ function group_post(&$a) {
        if(($a->argc == 2) && (intval($a->argv[1]))) {
                $r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($a->argv[1]),
-                       intval(get_uid())
+                       intval(local_user())
                );
                if(! count($r)) {
                        notice( t('Group not found.') . EOL );
@@ -49,7 +49,7 @@ function group_post(&$a) {
                if((strlen($groupname))  && ($groupname != $group['name'])) {
                        $r = q("UPDATE `group` SET `name` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1",
                                dbesc($groupname),
-                               intval(get_uid()),
+                               intval(local_user()),
                                intval($group['id'])
                        );
                        if($r)
@@ -59,14 +59,14 @@ function group_post(&$a) {
                array_walk($members,'validate_members');
                $r = q("DELETE FROM `group_member` WHERE `gid` = %d AND `uid` = %d",
                        intval($a->argv[1]),
-                       intval(get_uid())
+                       intval(local_user())
                );
                $result = true;
                if(count($members)) {
                        foreach($members as $member) {
                                $r = q("INSERT INTO `group_member` ( `uid`, `gid`, `contact-id`)
                                        VALUES ( %d, %d, %d )",
-                                       intval(get_uid()),
+                                       intval(local_user()),
                                        intval($group['id']),
                                        intval($member)
                                );
@@ -98,10 +98,10 @@ function group_content(&$a) {
                if(intval($a->argv[2])) {
                        $r = q("SELECT `name` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                intval($a->argv[2]),
-                               intval(get_uid())
+                               intval(local_user())
                        );
                        if(count($r)) 
-                               $result = group_rmv(get_uid(),$r[0]['name']);
+                               $result = group_rmv(local_user(),$r[0]['name']);
                        if($result)
                                notice( t('Group removed.') . EOL);
                        else
@@ -116,7 +116,7 @@ function group_content(&$a) {
                require_once('view/acl_selectors.php');
                $r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($a->argv[1]),
-                       intval(get_uid())
+                       intval(local_user())
                );
                if(! count($r)) {
                        notice( t('Group not found.') . EOL );
index c7782d4d756a4128632f965aadf1bf912866883a..ac528d221c2dcbe4294975d3168c13d819ae325e 100644 (file)
@@ -66,7 +66,7 @@ function like_content(&$a) {
        }
 
 
-       if((local_user()) && (get_uid() == $owner_uid)) {
+       if((local_user()) && (local_user() == $owner_uid)) {
                $contact = $owner;
        }
        else {
index 347b7817faaf8566060611653978cb3431f4df4d..3a747eac942c2f68635387e8351998a92929bc18 100644 (file)
@@ -175,7 +175,7 @@ function network_content(&$a, $update = 0) {
                        if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) 
                                continue;
 
-                       $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
+                       $lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
                                || strlen($item['deny_cid']) || strlen($item['deny_gid']))
                                ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
                                : '<div class="wall-item-lock"></div>');
index 603c1117ccfbe53ee34fab797c5c8f25098ef463..d09ec5edeb24b461c607298ede82896e4b6fd447 100644 (file)
@@ -17,7 +17,7 @@ function notifications_post(&$a) {
                        WHERE `request-id` = %d 
                        AND `uid` = %d LIMIT 1",
                                intval($request_id),
-                               intval(get_uid())
+                               intval(local_user())
                );
        
                if(count($r)) {
@@ -33,7 +33,7 @@ function notifications_post(&$a) {
                        );      
                        $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", 
                                intval($request_id),
-                               intval(get_uid())
+                               intval(local_user())
                        );
                        return;
                }
index 767c02543fb3b79dd608762235b4ca89ab94c90e..c1027fa22e108593dbbf533bc54758c4006d6bf3 100644 (file)
@@ -54,7 +54,7 @@ function photos_post(&$a) {
 
        $r = q("SELECT `contact`.* `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` 
                WHERE `user`.`uid` = %d AND `self` = 1 LIMIT 1",
-               intval(get_uid())
+               intval(local_user())
        );
 
        $contact_record = $r[0];        
@@ -70,7 +70,7 @@ function photos_post(&$a) {
 
                $r = q("SELECT count(*) FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
                        dbesc($album),
-                       intval(get_uid())
+                       intval(local_user())
                );
                if(! count($r)) {
                        notice( t('Album not found.') . EOL);
@@ -83,7 +83,7 @@ function photos_post(&$a) {
                        q("UPDATE `photo` SET `album` = '%s' WHERE `album` = '%s' AND `uid` = %d",
                                dbesc($newalbum),
                                dbesc($album),
-                               intval(get_uid())
+                               intval(local_user())
                        );
                        $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
                        goaway($a->get_baseurl() . '/' . $newurl);
@@ -94,7 +94,7 @@ function photos_post(&$a) {
 
                        $res = array();
                        $r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = %d AND `album` = '%s'",
-                               intval(get_uid()),
+                               intval(local_user()),
                                dbesc($album)
                        );
                        if(count($r)) {
@@ -109,17 +109,17 @@ function photos_post(&$a) {
                        $str_res = implode(',', $res);
 
                        q("DELETE FROM `photo` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
-                               intval(get_uid())
+                               intval(local_user())
                        );
                        $r = q("SELECT `parent-uri` FROM `item` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
-                               intval(get_uid())
+                               intval(local_user())
                        );
                        if(count($r)) {
                                foreach($r as $rr) {
                                        q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
                                                dbesc(datetime_convert()),
                                                dbesc($rr['parent-uri']),
-                                               intval(get_uid())
+                                               intval(local_user())
                                        );
 
                                        $drop_id = intval($rr['id']);
@@ -141,24 +141,24 @@ function photos_post(&$a) {
 
        if(($a->argc > 1) && (x($_POST,'delete')) && ($_POST['delete'] == t('Delete Photo'))) {
                $r = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' LIMIT 1",
-                       intval(get_uid()),
+                       intval(local_user()),
                        dbesc($a->argv[1])
                );
                if(count($r)) {
                        q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
-                               intval(get_uid()),
+                               intval(local_user()),
                                dbesc($r[0]['resource-id'])
                        );
                        $i = q("SELECT * FROM `item` WHERE `resource-id` = '%s' AND `uid` = %d LIMIT 1",
                                dbesc($r[0]['resource-id']),
-                               intval(get_uid())
+                               intval(local_user())
                        );
                        if(count($i)) {
                                q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
                                        dbesc(datetime_convert()),
                                        dbesc(datetime_convert()),
                                        dbesc($i[0]['uri']),
-                                       intval(get_uid())
+                                       intval(local_user())
                                );
 
                                $url = $a->get_baseurl();
@@ -189,25 +189,25 @@ function photos_post(&$a) {
 
                $p = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
                        dbesc($resource_id),
-                       intval(get_uid())
+                       intval(local_user())
                );
                if(count($r)) {
                        $r = q("UPDATE `photo` SET `desc` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
                                dbesc($desc),
                                dbesc($resource_id),
-                               intval(get_uid())
+                               intval(local_user())
                        );
                }
                if(! $item_id) {
 
                        $title = '';
                        $basename = basename($filename);
-                       $uri = item_new_uri($a->get_hostname(),get_uid());
+                       $uri = item_new_uri($a->get_hostname(),local_user());
                        // Create item container
 
                        $arr = array();
 
-                       $arr['uid']          = get_uid();
+                       $arr['uid']          = local_user();
                        $arr['uri']          = $uri;
                        $arr['parent-uri']   = $uri; 
                        $arr['type']         = 'photo';
@@ -236,7 +236,7 @@ function photos_post(&$a) {
                        dbesc(datetime_convert()),
                        dbesc(datetime_convert()),
                        intval($item_id),
-                       intval(get_uid())
+                       intval(local_user())
                );
 
                goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
@@ -266,7 +266,7 @@ function photos_post(&$a) {
 
        $r = q("SELECT * FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
                dbesc($album),
-               intval(get_uid())
+               intval(local_user())
        );
        if((! count($r)) || ($album == t('Profile Photos')))
                $visible = 1;
@@ -301,7 +301,7 @@ function photos_post(&$a) {
 
        $photo_hash = photo_new_resource();
 
-       $r = $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
+       $r = $ph->store(local_user(), 0, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
 
        if(! $r) {
                notice( t('Image upload failed.') . EOL );
@@ -310,25 +310,25 @@ function photos_post(&$a) {
 
        if($width > 640 || $height > 640) {
                $ph->scaleImage(640);
-               $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 1, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
+               $ph->store(local_user(), 0, $photo_hash, $filename, $album, 1, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
                $smallest = 1;
        }
 
        if($width > 320 || $height > 320) {
                $ph->scaleImage(320);
-               $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 2, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
+               $ph->store(local_user(), 0, $photo_hash, $filename, $album, 2, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
                $smallest = 2;
        }
        
        $basename = basename($filename);
-       $uri = item_new_uri($a->get_hostname(), get_uid());
+       $uri = item_new_uri($a->get_hostname(), local_user());
 
        // Create item container
 
 
        $arr = array();
 
-       $arr['uid']          = get_uid();
+       $arr['uid']          = local_user();
        $arr['uri']          = $uri;
        $arr['parent-uri']   = $uri;
        $arr['type']         = 'photo';
@@ -437,7 +437,7 @@ function photos_content(&$a) {
 
        // Profile owner - everything is visible
 
-       if(local_user() && (get_uid() == $owner_uid)) {
+       if(local_user() && (local_user() == $owner_uid)) {
                $sql_extra = '';        
        }
        elseif(remote_user()) {
@@ -466,7 +466,7 @@ function photos_content(&$a) {
 
 
        if($datatype === 'upload') {
-               if( ! (local_user() && (get_uid() == $a->data['user']['uid']))) {
+               if( ! (local_user() && (local_user() == $a->data['user']['uid']))) {
                        notice( t('Permission denied.'));
                        return;
                }
@@ -529,7 +529,7 @@ function photos_content(&$a) {
                
                if($cmd === 'edit') {           
                        if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
-                               if(local_user() && (get_uid() == $a->data['user']['uid'])) {
+                               if(local_user() && (local_user() == $a->data['user']['uid'])) {
                                        $edit_tpl = load_view_file('view/album_edit.tpl');
                                        $o .= replace_macros($edit_tpl,array(
                                                '$nametext' => t('New album name: '),
@@ -543,7 +543,7 @@ function photos_content(&$a) {
                }
                else {
                        if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
-                               if(local_user() && (get_uid() == $a->data['user']['uid'])) {
+                               if(local_user() && (local_user() == $a->data['user']['uid'])) {
                                        $o .= '<div id="album-edit-link"><a href="'. $a->get_baseurl() . '/photos/' 
                                                . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit' . '">' 
                                                . t('Edit Album') . '</a></div>';
@@ -602,7 +602,7 @@ function photos_content(&$a) {
                
                $o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']) . '">' . $ph[0]['album'] . '</a></h3>';
  
-               if(local_user() && ($ph[0]['uid'] == get_uid())) {
+               if(local_user() && ($ph[0]['uid'] == local_user())) {
                        $o .= '<div id="photo-edit-link-wrap" ><a id="photo-edit-link" href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/edit' . '">' . t('Edit photo') . '</a></div>';
                }
 
@@ -726,7 +726,7 @@ function photos_content(&$a) {
                                        }
 
 
-                                       if(local_user() && ($item['contact-uid'] == get_uid()) 
+                                       if(local_user() && ($item['contact-uid'] == local_user()) 
                                                && ($item['network'] == 'dfrn') && (! $item['self'] )) {
                                                $profile_url = $redirect_url;
                                                $sparkle = ' sparkle';
@@ -742,7 +742,7 @@ function photos_content(&$a) {
 
                                        $drop = '';
 
-                                       if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid()))
+                                       if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == local_user()))
                                                $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id']));
 
 
@@ -788,7 +788,7 @@ function photos_content(&$a) {
 
        $o .= '<h3>' . t('Recent Photos') . '</h3>';
 
-       if( local_user() && (get_uid() == $a->data['user']['uid'])) {
+       if( local_user() && (local_user() == $a->data['user']['uid'])) {
                $o .= '<div id="photo-top-links"><a id="photo-top-upload-link" href="'. $a->get_baseurl() . '/photos/' 
                        . $a->data['user']['nickname'] . '/upload' . '">' . t('Upload New Photos') . '</a></div>';
        }
index 9f7191758e02b1816a8e92f3bb1da39c2cefcf53..731562cd1a973b127a8e5f1b163c03f0188e4abf 100644 (file)
@@ -9,26 +9,26 @@ function ping_init(&$a) {
 
        $r = q("SELECT COUNT(*) AS `total` FROM `item` 
                WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d",
-               intval(get_uid())
+               intval(local_user())
        );
        $network = $r[0]['total'];
 
        $r = q("SELECT COUNT(*) AS `total` FROM `item` 
                WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `type` != 'remote' ",
-               intval(get_uid())
+               intval(local_user())
        );
        $home = $r[0]['total'];
 
        $r = q("SELECT COUNT(*) AS `total` FROM `intro` 
                WHERE `uid` = %d  AND `blocked` = 0 AND `ignore` = 0 ",
-               intval(get_uid())
+               intval(local_user())
        );
        $intro = $r[0]['total'];
 
        $myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
        $r = q("SELECT COUNT(*) AS `total` FROM `mail`
                WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
-               intval(get_uid()),
+               intval(local_user()),
                dbesc($myurl)
        );
 
index b72c279e2f9716bcd96b4fcda3cab7ab787d3e2b..5576b49dd128c4bc25da766d6cd27bda4cb9a59a 100644 (file)
@@ -90,7 +90,7 @@ function profile_content(&$a, $update = 0) {
                $a->profile['profile_uid'] = $update;
        }
        else {
-               if($a->profile['profile_uid'] == get_uid())             
+               if($a->profile['profile_uid'] == local_user())          
                        $o .= '<script> $(document).ready(function() { $(\'#nav-home-link\').addClass(\'nav-selected\'); });</script>';
        }
 
@@ -308,7 +308,7 @@ function profile_content(&$a, $update = 0) {
                        if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) 
                                continue;
 
-                       $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
+                       $lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
                                || strlen($item['deny_cid']) || strlen($item['deny_gid']))
                                ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
                                : '<div class="wall-item-lock"></div>');
index 07df671da46e101dcaa76992a90f682ea91eab7d..b21d9162a01e3622ccf6ec8a8abfc6e1f66efe5b 100644 (file)
@@ -45,7 +45,7 @@ function profile_photo_post(&$a) {
 //dbg(3);
                $r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d AND `scale` = %d LIMIT 1",
                        dbesc($image_id),
-                       dbesc(get_uid()),
+                       dbesc(local_user()),
                        intval($scale));
 
                if(count($r)) {
@@ -56,14 +56,14 @@ function profile_photo_post(&$a) {
                        if($im->is_valid()) {
                                $im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
 
-                               $r = $im->store(get_uid(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 4, 1);
+                               $r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 4, 1);
 
                                if($r === false)
                                        notice ( t('Image size reduction [175] failed.') . EOL );
 
                                $im->scaleImage(80);
 
-                               $r = $im->store(get_uid(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 5, 1);
+                               $r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 5, 1);
                        
                                if($r === false)
                                        notice( t('Image size reduction [80] failed.') . EOL );
@@ -72,12 +72,12 @@ function profile_photo_post(&$a) {
 
                                $r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' AND `uid` = %d",
                                        dbesc($base_image['resource-id']),
-                                       intval(get_uid())
+                                       intval(local_user())
                                );
 
                                $r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d LIMIT 1",
                                        dbesc(datetime_convert()),
-                                       intval(get_uid())
+                                       intval(local_user())
                                );
 
                                // Update global directory in background
@@ -123,7 +123,7 @@ function profile_photo_post(&$a) {
 
        $smallest = 0;
 
-       $r = $ph->store(get_uid(), 0 , $hash, $filename, t('Profile Photos'), 0 );      
+       $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 );   
 
        if($r)
                notice( t('Image uploaded successfully.') . EOL );
@@ -132,7 +132,7 @@ function profile_photo_post(&$a) {
 
        if($width > 640 || $height > 640) {
                $ph->scaleImage(640);
-               $r = $ph->store(get_uid(), 0 , $hash, $filename, t('Profile Photos'), 1 );      
+               $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 1 );   
 
                if($r === false)
                        notice( t('Image size reduction [640] failed.') . EOL );
index e743d003e53d0c18d287c95f28cfbe9cf8142cf2..5427d8c786e93f5be407bca3b099f4f8fc071314 100644 (file)
@@ -6,7 +6,7 @@ function redir_init(&$a) {
                goaway($a->get_baseurl());
        $r = q("SELECT `network`, `issued-id`, `dfrn-id`, `duplex`, `poll` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                intval($a->argv[1]),
-               intval(get_uid())
+               intval(local_user())
        );
        if((! count($r)) || ($r[0]['network'] !== 'dfrn'))
                goaway($a->get_baseurl());
index 7adc5e6de35a30fc448a1909b5502e69292bde0c..720a38e8d6aaaa3f46cb25963e8e5d80e259b497 100644 (file)
@@ -15,7 +15,7 @@ function settings_post(&$a) {
                notice( t('Permission denied.') . EOL);
                return;
        }
-       if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != get_uid()) {
+       if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
@@ -39,7 +39,7 @@ function settings_post(&$a) {
                        $password = hash('whirlpool',$newpass);
                        $r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d LIMIT 1",
                                dbesc($password),
-                               intval(get_uid())
+                               intval(local_user())
                        );
                        if($r)
                                notice( t('Password changed.') . EOL);
@@ -116,7 +116,7 @@ function settings_post(&$a) {
                        intval($page_flags),
                        dbesc($defloc),
                        dbesc($theme),
-                       intval(get_uid())
+                       intval(local_user())
        );
        if($r)
                notice( t('Settings updated.') . EOL);
@@ -126,7 +126,7 @@ function settings_post(&$a) {
                WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
                intval($publish),
                intval($net_publish),
-               intval(get_uid())
+               intval(local_user())
        );
 
        if($old_visibility != $net_publish) {
index 9875a01adeafc9ff1ee9827c3676aa5d5f77390b..77c4eb4fd8b237ef7f08eaa65f478445d7602a65 100644 (file)
@@ -34,7 +34,7 @@ function wall_upload_post(&$a) {
        
        $smallest = 0;
 
-       $r = $ph->store(get_uid(), 0, $hash, $filename, t('Wall Photos'), 0 );
+       $r = $ph->store(local_user(), 0, $hash, $filename, t('Wall Photos'), 0 );
 
        if(! $r) {
                echo ( t('Image upload failed.') . EOL);
@@ -43,14 +43,14 @@ function wall_upload_post(&$a) {
 
        if($width > 640 || $height > 640) {
                $ph->scaleImage(640);
-               $r = $ph->store(get_uid(), 0, $hash, $filename, t('Wall Photos'), 1 );
+               $r = $ph->store(local_user(), 0, $hash, $filename, t('Wall Photos'), 1 );
                if($r) 
                        $smallest = 1;
        }
 
        if($width > 320 || $height > 320) {
                $ph->scaleImage(320);
-               $r = $ph->store(get_uid(), 0, $hash, $filename, t('Wall Photos'), 2 );
+               $r = $ph->store(local_user(), 0, $hash, $filename, t('Wall Photos'), 2 );
                if($r)
                        $smallest = 2;
        }