aboutsummaryrefslogtreecommitdiffstats
path: root/include/identity.php
diff options
context:
space:
mode:
authorStefan Parviainen <saparvia@caterva.eu>2014-11-08 20:53:41 +0100
committerStefan Parviainen <saparvia@caterva.eu>2014-11-08 20:53:41 +0100
commitb5fad9feefd0f261807222d8a4c42ead6253a65c (patch)
tree399cd4a1b79f61530924ea59670af0bdd6cee5be /include/identity.php
parent89aea081825ec7b11b00833a9bec2c74900bfcb6 (diff)
parentb29a968be8df52cd7c9b6d5bebb618534788337c (diff)
downloadvolse-hubzilla-b5fad9feefd0f261807222d8a4c42ead6253a65c.tar.gz
volse-hubzilla-b5fad9feefd0f261807222d8a4c42ead6253a65c.tar.bz2
volse-hubzilla-b5fad9feefd0f261807222d8a4c42ead6253a65c.zip
Fix merge conflict
Diffstat (limited to 'include/identity.php')
-rw-r--r--include/identity.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/identity.php b/include/identity.php
index 07bfaebbd..b9ee00623 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -176,6 +176,7 @@ function create_identity($arr) {
// save this for auto_friending
$total_identities = $ret['total_identities'];
+
$nick = mb_strtolower(trim($arr['nickname']));
if(! $nick) {
$ret['message'] = t('Nickname is required.');
@@ -347,10 +348,13 @@ function create_identity($arr) {
dbesc($a->get_baseurl() . "/photo/profile/m/{$newuid}")
);
- $myperms = 0;
if($role_permissions) {
$myperms = ((array_key_exists('perms_auto',$role_permissions) && $role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0);
}
+ else
+ $myperms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
+ |PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
+ |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_closeness, abook_created, abook_updated, abook_flags, abook_my_perms )
values ( %d, %d, '%s', %d, '%s', '%s', %d, %d ) ",
@@ -372,6 +376,8 @@ function create_identity($arr) {
set_pconfig($newuid,'system','permissions_role',$arr['permissions_role']);
if(array_key_exists('online',$role_permissions))
set_pconfig($newuid,'system','hide_presence',1-intval($role_permissions['online']));
+ if(array_key_exists('perms_auto',$role_permissions))
+ set_pconfig($newuid,'system','autoperms',(($role_permissions['perms_auto']) ? $role_permissions['perms_accept'] : 0));
}
// Create a group with yourself as a member. This allows somebody to use it
@@ -389,7 +395,8 @@ function create_identity($arr) {
dbesc( t('Friends') )
);
if($r) {
- q("update channel set channel_allow_gid = '%s' where channel_id = %d limit 1",
+ q("update channel set channel_default_group = '%s', channel_allow_gid = '%s' where channel_id = %d limit 1",
+ dbesc($r[0]['hash']),
dbesc('<' . $r[0]['hash'] . '>'),
intval($newuid)
);
@@ -403,6 +410,7 @@ function create_identity($arr) {
$accts = get_config('system','auto_follow');
if(($accts) && (! $total_identities)) {
+ require_once('include/follow.php');
if(! is_array($accts))
$accts = array($accts);
foreach($accts as $acct) {
@@ -1558,4 +1566,16 @@ function notifications_on($channel_id,$value) {
intval($channel_id)
);
return $x;
+}
+
+
+function get_channel_default_perms($uid) {
+
+ $r = q("select abook_my_perms from abook where abook_channel = %d and abook_flags & %d limit 1",
+ intval($uid),
+ intval(ABOOK_FLAG_SELF)
+ );
+ if($r)
+ return $r[0]['abook_my_perms'];
+ return 0;
} \ No newline at end of file