eradicate redundant get_uid function
This commit is contained in:
parent
103814ab8e
commit
ac824fe83e
7
boot.php
7
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
|
// Take a URL from the wild, prepend http:// if necessary
|
||||||
// and check DNS to see if it's real
|
// and check DNS to see if it's real
|
||||||
// return true if it's OK, false if something is wrong with it
|
// return true if it's OK, false if something is wrong with it
|
||||||
|
|
|
@ -16,7 +16,7 @@ function user_remove($uid) {
|
||||||
q("DELETE FROM `profile` WHERE `uid` = %d", intval($uid));
|
q("DELETE FROM `profile` WHERE `uid` = %d", intval($uid));
|
||||||
q("DELETE FROM `profile_check` WHERE `uid` = %d", intval($uid));
|
q("DELETE FROM `profile_check` WHERE `uid` = %d", intval($uid));
|
||||||
q("DELETE FROM `user` 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['authenticated']);
|
||||||
unset($_SESSION['uid']);
|
unset($_SESSION['uid']);
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -4,7 +4,7 @@ function can_write_wall(&$a,$owner) {
|
||||||
|
|
||||||
if((! (local_user())) && (! (remote_user())))
|
if((! (local_user())) && (! (remote_user())))
|
||||||
return false;
|
return false;
|
||||||
$uid = get_uid();
|
$uid = local_user();
|
||||||
|
|
||||||
if(($uid) && ($uid == $owner)) {
|
if(($uid) && ($uid == $owner)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -21,7 +21,7 @@ function contacts_post(&$a) {
|
||||||
|
|
||||||
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! count($orig_record)) {
|
if(! count($orig_record)) {
|
||||||
|
@ -34,7 +34,7 @@ function contacts_post(&$a) {
|
||||||
if($profile_id) {
|
if($profile_id) {
|
||||||
$r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($profile_id),
|
intval($profile_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if(! count($r)) {
|
if(! count($r)) {
|
||||||
notice( t('Could not locate selected profile.') . EOL);
|
notice( t('Could not locate selected profile.') . EOL);
|
||||||
|
@ -62,7 +62,7 @@ function contacts_post(&$a) {
|
||||||
intval($rating),
|
intval($rating),
|
||||||
dbesc($reason),
|
dbesc($reason),
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if($r)
|
if($r)
|
||||||
notice( t('Contact updated.') . EOL);
|
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",
|
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! count($orig_record)) {
|
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",
|
$r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($blocked),
|
intval($blocked),
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
notice( t('Contact has been ') . (($blocked) ? t('blocked') : t('unblocked')) . EOL );
|
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",
|
$r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($readonly),
|
intval($readonly),
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
notice( t('Contact has been ') . (($readonly) ? t('ignored') : t('unignored')) . EOL );
|
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]);
|
$contact_id = intval($a->argv[1]);
|
||||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1",
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
intval($contact_id)
|
intval($contact_id)
|
||||||
);
|
);
|
||||||
if(! count($r)) {
|
if(! count($r)) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
||||||
|
|
||||||
if(! x($_POST,'source_url')) {
|
if(! x($_POST,'source_url')) {
|
||||||
|
|
||||||
$uid = ((is_array($handsfree)) ? $handsfree['uid'] : get_uid());
|
$uid = ((is_array($handsfree)) ? $handsfree['uid'] : local_user());
|
||||||
|
|
||||||
if(! $uid) {
|
if(! $uid) {
|
||||||
notice( t('Permission denied.') . EOL );
|
notice( t('Permission denied.') . EOL );
|
||||||
|
|
|
@ -45,7 +45,7 @@ function dfrn_request_post(&$a) {
|
||||||
if(x($dfrn_url)) {
|
if(x($dfrn_url)) {
|
||||||
|
|
||||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
dbesc($dfrn_url)
|
dbesc($dfrn_url)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ function dfrn_request_post(&$a) {
|
||||||
$r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `name`, `photo`, `site-pubkey`,
|
$r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `name`, `photo`, `site-pubkey`,
|
||||||
`request`, `confirm`, `notify`, `poll`, `aes_allow`)
|
`request`, `confirm`, `notify`, `poll`, `aes_allow`)
|
||||||
VALUES ( %d, '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', %d)",
|
VALUES ( %d, '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', %d)",
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
datetime_convert(),
|
datetime_convert(),
|
||||||
dbesc($dfrn_url),
|
dbesc($dfrn_url),
|
||||||
$parms['fn'],
|
$parms['fn'],
|
||||||
|
|
|
@ -57,7 +57,7 @@ function display_content(&$a) {
|
||||||
|
|
||||||
// Profile owner - everything is visible
|
// Profile owner - everything is visible
|
||||||
|
|
||||||
if(local_user() && (get_uid() == $a->profile['uid'])) {
|
if(local_user() && (local_user() == $a->profile['uid'])) {
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ function display_content(&$a) {
|
||||||
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
||||||
continue;
|
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']))
|
|| 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"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
|
||||||
: '<div class="wall-item-lock"></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_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
|
||||||
$profile_link = $profile_url;
|
$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']));
|
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id']));
|
||||||
else
|
else
|
||||||
$drop = replace_macros(load_view_file('view/wall_fake_drop.tpl'), array('$id' => $item['id']));
|
$drop = replace_macros(load_view_file('view/wall_fake_drop.tpl'), array('$id' => $item['id']));
|
||||||
|
|
|
@ -22,10 +22,10 @@ function group_post(&$a) {
|
||||||
|
|
||||||
if(($a->argc == 2) && ($a->argv[1] === 'new')) {
|
if(($a->argc == 2) && ($a->argv[1] === 'new')) {
|
||||||
$name = notags(trim($_POST['groupname']));
|
$name = notags(trim($_POST['groupname']));
|
||||||
$r = group_add(get_uid(),$name);
|
$r = group_add(local_user(),$name);
|
||||||
if($r) {
|
if($r) {
|
||||||
notice( t('Group created.') . EOL );
|
notice( t('Group created.') . EOL );
|
||||||
$r = group_byname(get_uid(),$name);
|
$r = group_byname(local_user(),$name);
|
||||||
if($r)
|
if($r)
|
||||||
goaway($a->get_baseurl() . '/group/' . $r);
|
goaway($a->get_baseurl() . '/group/' . $r);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ function group_post(&$a) {
|
||||||
if(($a->argc == 2) && (intval($a->argv[1]))) {
|
if(($a->argc == 2) && (intval($a->argv[1]))) {
|
||||||
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if(! count($r)) {
|
if(! count($r)) {
|
||||||
notice( t('Group not found.') . EOL );
|
notice( t('Group not found.') . EOL );
|
||||||
|
@ -49,7 +49,7 @@ function group_post(&$a) {
|
||||||
if((strlen($groupname)) && ($groupname != $group['name'])) {
|
if((strlen($groupname)) && ($groupname != $group['name'])) {
|
||||||
$r = q("UPDATE `group` SET `name` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
$r = q("UPDATE `group` SET `name` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||||
dbesc($groupname),
|
dbesc($groupname),
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
intval($group['id'])
|
intval($group['id'])
|
||||||
);
|
);
|
||||||
if($r)
|
if($r)
|
||||||
|
@ -59,14 +59,14 @@ function group_post(&$a) {
|
||||||
array_walk($members,'validate_members');
|
array_walk($members,'validate_members');
|
||||||
$r = q("DELETE FROM `group_member` WHERE `gid` = %d AND `uid` = %d",
|
$r = q("DELETE FROM `group_member` WHERE `gid` = %d AND `uid` = %d",
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
$result = true;
|
$result = true;
|
||||||
if(count($members)) {
|
if(count($members)) {
|
||||||
foreach($members as $member) {
|
foreach($members as $member) {
|
||||||
$r = q("INSERT INTO `group_member` ( `uid`, `gid`, `contact-id`)
|
$r = q("INSERT INTO `group_member` ( `uid`, `gid`, `contact-id`)
|
||||||
VALUES ( %d, %d, %d )",
|
VALUES ( %d, %d, %d )",
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
intval($group['id']),
|
intval($group['id']),
|
||||||
intval($member)
|
intval($member)
|
||||||
);
|
);
|
||||||
|
@ -98,10 +98,10 @@ function group_content(&$a) {
|
||||||
if(intval($a->argv[2])) {
|
if(intval($a->argv[2])) {
|
||||||
$r = q("SELECT `name` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `name` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if(count($r))
|
if(count($r))
|
||||||
$result = group_rmv(get_uid(),$r[0]['name']);
|
$result = group_rmv(local_user(),$r[0]['name']);
|
||||||
if($result)
|
if($result)
|
||||||
notice( t('Group removed.') . EOL);
|
notice( t('Group removed.') . EOL);
|
||||||
else
|
else
|
||||||
|
@ -116,7 +116,7 @@ function group_content(&$a) {
|
||||||
require_once('view/acl_selectors.php');
|
require_once('view/acl_selectors.php');
|
||||||
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if(! count($r)) {
|
if(! count($r)) {
|
||||||
notice( t('Group not found.') . EOL );
|
notice( t('Group not found.') . EOL );
|
||||||
|
|
|
@ -66,7 +66,7 @@ function like_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if((local_user()) && (get_uid() == $owner_uid)) {
|
if((local_user()) && (local_user() == $owner_uid)) {
|
||||||
$contact = $owner;
|
$contact = $owner;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -175,7 +175,7 @@ function network_content(&$a, $update = 0) {
|
||||||
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
||||||
continue;
|
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']))
|
|| 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"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
|
||||||
: '<div class="wall-item-lock"></div>');
|
: '<div class="wall-item-lock"></div>');
|
||||||
|
|
|
@ -17,7 +17,7 @@ function notifications_post(&$a) {
|
||||||
WHERE `request-id` = %d
|
WHERE `request-id` = %d
|
||||||
AND `uid` = %d LIMIT 1",
|
AND `uid` = %d LIMIT 1",
|
||||||
intval($request_id),
|
intval($request_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
@ -33,7 +33,7 @@ function notifications_post(&$a) {
|
||||||
);
|
);
|
||||||
$r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($request_id),
|
intval($request_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ function photos_post(&$a) {
|
||||||
|
|
||||||
$r = q("SELECT `contact`.* `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
$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",
|
WHERE `user`.`uid` = %d AND `self` = 1 LIMIT 1",
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
$contact_record = $r[0];
|
$contact_record = $r[0];
|
||||||
|
@ -70,7 +70,7 @@ function photos_post(&$a) {
|
||||||
|
|
||||||
$r = q("SELECT count(*) FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
|
$r = q("SELECT count(*) FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if(! count($r)) {
|
if(! count($r)) {
|
||||||
notice( t('Album not found.') . EOL);
|
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",
|
q("UPDATE `photo` SET `album` = '%s' WHERE `album` = '%s' AND `uid` = %d",
|
||||||
dbesc($newalbum),
|
dbesc($newalbum),
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
$newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
|
$newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
|
||||||
goaway($a->get_baseurl() . '/' . $newurl);
|
goaway($a->get_baseurl() . '/' . $newurl);
|
||||||
|
@ -94,7 +94,7 @@ function photos_post(&$a) {
|
||||||
|
|
||||||
$res = array();
|
$res = array();
|
||||||
$r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = %d AND `album` = '%s'",
|
$r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = %d AND `album` = '%s'",
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
@ -109,17 +109,17 @@ function photos_post(&$a) {
|
||||||
$str_res = implode(',', $res);
|
$str_res = implode(',', $res);
|
||||||
|
|
||||||
q("DELETE FROM `photo` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
|
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",
|
$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)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc($rr['parent-uri']),
|
dbesc($rr['parent-uri']),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
$drop_id = intval($rr['id']);
|
$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'))) {
|
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",
|
$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])
|
dbesc($a->argv[1])
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
|
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
dbesc($r[0]['resource-id'])
|
dbesc($r[0]['resource-id'])
|
||||||
);
|
);
|
||||||
$i = q("SELECT * FROM `item` WHERE `resource-id` = '%s' AND `uid` = %d LIMIT 1",
|
$i = q("SELECT * FROM `item` WHERE `resource-id` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($r[0]['resource-id']),
|
dbesc($r[0]['resource-id']),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if(count($i)) {
|
if(count($i)) {
|
||||||
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc($i[0]['uri']),
|
dbesc($i[0]['uri']),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
$url = $a->get_baseurl();
|
$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",
|
$p = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
|
||||||
dbesc($resource_id),
|
dbesc($resource_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$r = q("UPDATE `photo` SET `desc` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
|
$r = q("UPDATE `photo` SET `desc` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
|
||||||
dbesc($desc),
|
dbesc($desc),
|
||||||
dbesc($resource_id),
|
dbesc($resource_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(! $item_id) {
|
if(! $item_id) {
|
||||||
|
|
||||||
$title = '';
|
$title = '';
|
||||||
$basename = basename($filename);
|
$basename = basename($filename);
|
||||||
$uri = item_new_uri($a->get_hostname(),get_uid());
|
$uri = item_new_uri($a->get_hostname(),local_user());
|
||||||
// Create item container
|
// Create item container
|
||||||
|
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
||||||
$arr['uid'] = get_uid();
|
$arr['uid'] = local_user();
|
||||||
$arr['uri'] = $uri;
|
$arr['uri'] = $uri;
|
||||||
$arr['parent-uri'] = $uri;
|
$arr['parent-uri'] = $uri;
|
||||||
$arr['type'] = 'photo';
|
$arr['type'] = 'photo';
|
||||||
|
@ -236,7 +236,7 @@ function photos_post(&$a) {
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($item_id),
|
intval($item_id),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
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",
|
$r = q("SELECT * FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if((! count($r)) || ($album == t('Profile Photos')))
|
if((! count($r)) || ($album == t('Profile Photos')))
|
||||||
$visible = 1;
|
$visible = 1;
|
||||||
|
@ -301,7 +301,7 @@ function photos_post(&$a) {
|
||||||
|
|
||||||
$photo_hash = photo_new_resource();
|
$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) {
|
if(! $r) {
|
||||||
notice( t('Image upload failed.') . EOL );
|
notice( t('Image upload failed.') . EOL );
|
||||||
|
@ -310,25 +310,25 @@ function photos_post(&$a) {
|
||||||
|
|
||||||
if($width > 640 || $height > 640) {
|
if($width > 640 || $height > 640) {
|
||||||
$ph->scaleImage(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;
|
$smallest = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($width > 320 || $height > 320) {
|
if($width > 320 || $height > 320) {
|
||||||
$ph->scaleImage(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;
|
$smallest = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$basename = basename($filename);
|
$basename = basename($filename);
|
||||||
$uri = item_new_uri($a->get_hostname(), get_uid());
|
$uri = item_new_uri($a->get_hostname(), local_user());
|
||||||
|
|
||||||
// Create item container
|
// Create item container
|
||||||
|
|
||||||
|
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
||||||
$arr['uid'] = get_uid();
|
$arr['uid'] = local_user();
|
||||||
$arr['uri'] = $uri;
|
$arr['uri'] = $uri;
|
||||||
$arr['parent-uri'] = $uri;
|
$arr['parent-uri'] = $uri;
|
||||||
$arr['type'] = 'photo';
|
$arr['type'] = 'photo';
|
||||||
|
@ -437,7 +437,7 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
// Profile owner - everything is visible
|
// Profile owner - everything is visible
|
||||||
|
|
||||||
if(local_user() && (get_uid() == $owner_uid)) {
|
if(local_user() && (local_user() == $owner_uid)) {
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
}
|
}
|
||||||
elseif(remote_user()) {
|
elseif(remote_user()) {
|
||||||
|
@ -466,7 +466,7 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
if($datatype === 'upload') {
|
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.'));
|
notice( t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -529,7 +529,7 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
if($cmd === 'edit') {
|
if($cmd === 'edit') {
|
||||||
if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
|
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');
|
$edit_tpl = load_view_file('view/album_edit.tpl');
|
||||||
$o .= replace_macros($edit_tpl,array(
|
$o .= replace_macros($edit_tpl,array(
|
||||||
'$nametext' => t('New album name: '),
|
'$nametext' => t('New album name: '),
|
||||||
|
@ -543,7 +543,7 @@ function photos_content(&$a) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
|
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/'
|
$o .= '<div id="album-edit-link"><a href="'. $a->get_baseurl() . '/photos/'
|
||||||
. $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit' . '">'
|
. $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit' . '">'
|
||||||
. t('Edit Album') . '</a></div>';
|
. 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>';
|
$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>';
|
$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'] )) {
|
&& ($item['network'] == 'dfrn') && (! $item['self'] )) {
|
||||||
$profile_url = $redirect_url;
|
$profile_url = $redirect_url;
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
|
@ -742,7 +742,7 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
$drop = '';
|
$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']));
|
$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>';
|
$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/'
|
$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>';
|
. $a->data['user']['nickname'] . '/upload' . '">' . t('Upload New Photos') . '</a></div>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,26 +9,26 @@ function ping_init(&$a) {
|
||||||
|
|
||||||
$r = q("SELECT COUNT(*) AS `total` FROM `item`
|
$r = q("SELECT COUNT(*) AS `total` FROM `item`
|
||||||
WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d",
|
WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d",
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
$network = $r[0]['total'];
|
$network = $r[0]['total'];
|
||||||
|
|
||||||
$r = q("SELECT COUNT(*) AS `total` FROM `item`
|
$r = q("SELECT COUNT(*) AS `total` FROM `item`
|
||||||
WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `type` != 'remote' ",
|
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'];
|
$home = $r[0]['total'];
|
||||||
|
|
||||||
$r = q("SELECT COUNT(*) AS `total` FROM `intro`
|
$r = q("SELECT COUNT(*) AS `total` FROM `intro`
|
||||||
WHERE `uid` = %d AND `blocked` = 0 AND `ignore` = 0 ",
|
WHERE `uid` = %d AND `blocked` = 0 AND `ignore` = 0 ",
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
$intro = $r[0]['total'];
|
$intro = $r[0]['total'];
|
||||||
|
|
||||||
$myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
|
$myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
|
||||||
$r = q("SELECT COUNT(*) AS `total` FROM `mail`
|
$r = q("SELECT COUNT(*) AS `total` FROM `mail`
|
||||||
WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
|
WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
|
||||||
intval(get_uid()),
|
intval(local_user()),
|
||||||
dbesc($myurl)
|
dbesc($myurl)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
$a->profile['profile_uid'] = $update;
|
$a->profile['profile_uid'] = $update;
|
||||||
}
|
}
|
||||||
else {
|
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>';
|
$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']))
|
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
||||||
continue;
|
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']))
|
|| 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"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
|
||||||
: '<div class="wall-item-lock"></div>');
|
: '<div class="wall-item-lock"></div>');
|
||||||
|
|
|
@ -45,7 +45,7 @@ function profile_photo_post(&$a) {
|
||||||
//dbg(3);
|
//dbg(3);
|
||||||
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d AND `scale` = %d LIMIT 1",
|
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d AND `scale` = %d LIMIT 1",
|
||||||
dbesc($image_id),
|
dbesc($image_id),
|
||||||
dbesc(get_uid()),
|
dbesc(local_user()),
|
||||||
intval($scale));
|
intval($scale));
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
@ -56,14 +56,14 @@ function profile_photo_post(&$a) {
|
||||||
if($im->is_valid()) {
|
if($im->is_valid()) {
|
||||||
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
|
$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)
|
if($r === false)
|
||||||
notice ( t('Image size reduction [175] failed.') . EOL );
|
notice ( t('Image size reduction [175] failed.') . EOL );
|
||||||
|
|
||||||
$im->scaleImage(80);
|
$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)
|
if($r === false)
|
||||||
notice( t('Image size reduction [80] failed.') . EOL );
|
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",
|
$r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' AND `uid` = %d",
|
||||||
dbesc($base_image['resource-id']),
|
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",
|
$r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update global directory in background
|
// Update global directory in background
|
||||||
|
@ -123,7 +123,7 @@ function profile_photo_post(&$a) {
|
||||||
|
|
||||||
$smallest = 0;
|
$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)
|
if($r)
|
||||||
notice( t('Image uploaded successfully.') . EOL );
|
notice( t('Image uploaded successfully.') . EOL );
|
||||||
|
@ -132,7 +132,7 @@ function profile_photo_post(&$a) {
|
||||||
|
|
||||||
if($width > 640 || $height > 640) {
|
if($width > 640 || $height > 640) {
|
||||||
$ph->scaleImage(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)
|
if($r === false)
|
||||||
notice( t('Image size reduction [640] failed.') . EOL );
|
notice( t('Image size reduction [640] failed.') . EOL );
|
||||||
|
|
|
@ -6,7 +6,7 @@ function redir_init(&$a) {
|
||||||
goaway($a->get_baseurl());
|
goaway($a->get_baseurl());
|
||||||
$r = q("SELECT `network`, `issued-id`, `dfrn-id`, `duplex`, `poll` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$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($a->argv[1]),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if((! count($r)) || ($r[0]['network'] !== 'dfrn'))
|
if((! count($r)) || ($r[0]['network'] !== 'dfrn'))
|
||||||
goaway($a->get_baseurl());
|
goaway($a->get_baseurl());
|
||||||
|
|
|
@ -15,7 +15,7 @@ function settings_post(&$a) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
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);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ function settings_post(&$a) {
|
||||||
$password = hash('whirlpool',$newpass);
|
$password = hash('whirlpool',$newpass);
|
||||||
$r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d LIMIT 1",
|
$r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d LIMIT 1",
|
||||||
dbesc($password),
|
dbesc($password),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if($r)
|
if($r)
|
||||||
notice( t('Password changed.') . EOL);
|
notice( t('Password changed.') . EOL);
|
||||||
|
@ -116,7 +116,7 @@ function settings_post(&$a) {
|
||||||
intval($page_flags),
|
intval($page_flags),
|
||||||
dbesc($defloc),
|
dbesc($defloc),
|
||||||
dbesc($theme),
|
dbesc($theme),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if($r)
|
if($r)
|
||||||
notice( t('Settings updated.') . EOL);
|
notice( t('Settings updated.') . EOL);
|
||||||
|
@ -126,7 +126,7 @@ function settings_post(&$a) {
|
||||||
WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
|
WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
|
||||||
intval($publish),
|
intval($publish),
|
||||||
intval($net_publish),
|
intval($net_publish),
|
||||||
intval(get_uid())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if($old_visibility != $net_publish) {
|
if($old_visibility != $net_publish) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ function wall_upload_post(&$a) {
|
||||||
|
|
||||||
$smallest = 0;
|
$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) {
|
if(! $r) {
|
||||||
echo ( t('Image upload failed.') . EOL);
|
echo ( t('Image upload failed.') . EOL);
|
||||||
|
@ -43,14 +43,14 @@ function wall_upload_post(&$a) {
|
||||||
|
|
||||||
if($width > 640 || $height > 640) {
|
if($width > 640 || $height > 640) {
|
||||||
$ph->scaleImage(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)
|
if($r)
|
||||||
$smallest = 1;
|
$smallest = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($width > 320 || $height > 320) {
|
if($width > 320 || $height > 320) {
|
||||||
$ph->scaleImage(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)
|
if($r)
|
||||||
$smallest = 2;
|
$smallest = 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue