diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/AccessList.php | 9 | ||||
-rw-r--r-- | Zotlabs/Lib/Activity.php | 56 | ||||
-rw-r--r-- | Zotlabs/Lib/ActivityStreams.php | 1 | ||||
-rw-r--r-- | Zotlabs/Lib/Permcat.php | 65 | ||||
-rw-r--r-- | Zotlabs/Module/Admin/Site.php | 7 | ||||
-rw-r--r-- | Zotlabs/Module/Permcats.php | 167 | ||||
-rw-r--r-- | Zotlabs/Module/Wfinger.php | 13 | ||||
-rw-r--r-- | Zotlabs/Update/_1252.php | 23 |
8 files changed, 205 insertions, 136 deletions
diff --git a/Zotlabs/Lib/AccessList.php b/Zotlabs/Lib/AccessList.php index 03052fab5..026148c9f 100644 --- a/Zotlabs/Lib/AccessList.php +++ b/Zotlabs/Lib/AccessList.php @@ -160,8 +160,10 @@ class AccessList { return false; } - static function member_remove($uid, $name, $member) { - $gid = self::by_name($uid, $name); + static function member_remove($uid, $name, $member, $gid = 0) { + if (!$gid) { + $gid = self::by_name($uid, $name); + } if (!($uid && $gid && $member)) { return false; @@ -192,7 +194,8 @@ class AccessList { dbesc($member) ); if ($r) { - return true; // You might question this, but + return true; + // You might question this, but // we indicate success because the group member was in fact created // -- It was just created at another time } diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 2de25885a..74a146345 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1748,7 +1748,7 @@ class Activity { // update existing xchan record q("update xchan set xchan_name = '%s', xchan_guid = '%s', xchan_pubkey = '%s', xchan_addr = '%s', xchan_network = 'activitypub', xchan_name_date = '%s' where xchan_hash = '%s'", dbesc(escape_tags($name)), - dbesc(escape_tags($url)), + dbesc($url), dbesc(escape_tags($pubkey)), dbesc(escape_tags($webfinger_addr)), dbescdate(datetime_convert()), @@ -1757,13 +1757,13 @@ class Activity { // update existing hubloc record q("update hubloc set hubloc_guid = '%s', hubloc_addr = '%s', hubloc_network = 'activitypub', hubloc_url = '%s', hubloc_host = '%s', hubloc_callback = '%s', hubloc_updated = '%s', hubloc_id_url = '%s' where hubloc_hash = '%s'", - dbesc(escape_tags($url)), + dbesc($url), dbesc(escape_tags($webfinger_addr)), - dbesc(escape_tags($baseurl)), - dbesc(escape_tags($hostname)), - dbesc(escape_tags($inbox)), + dbesc($baseurl), + dbesc($hostname), + dbesc($inbox), dbescdate(datetime_convert()), - dbesc(escape_tags($profile)), + dbesc($profile), dbesc($url) ); } @@ -1772,8 +1772,8 @@ class Activity { xchan_store_lowlevel( [ - 'xchan_hash' => escape_tags($url), - 'xchan_guid' => escape_tags($url), + 'xchan_hash' => $url, + 'xchan_guid' => $url, 'xchan_pubkey' => escape_tags($pubkey), 'xchan_addr' => $webfinger_addr, 'xchan_url' => escape_tags($profile), @@ -1785,16 +1785,16 @@ class Activity { hubloc_store_lowlevel( [ - 'hubloc_guid' => escape_tags($url), - 'hubloc_hash' => escape_tags($url), + 'hubloc_guid' => $url, + 'hubloc_hash' => $url, 'hubloc_addr' => $webfinger_addr, 'hubloc_network' => 'activitypub', - 'hubloc_url' => escape_tags($baseurl), - 'hubloc_host' => escape_tags($hostname), - 'hubloc_callback' => escape_tags($inbox), + 'hubloc_url' => $baseurl, + 'hubloc_host' => $hostname, + 'hubloc_callback' => $inbox, 'hubloc_updated' => datetime_convert(), 'hubloc_primary' => 1, - 'hubloc_id_url' => escape_tags($profile) + 'hubloc_id_url' => $profile ] ); } @@ -2638,13 +2638,35 @@ class Activity { } } - set_iconfig($s, 'activitypub', 'recips', $act->raw_recips); + $zot_rawmsg = ''; + $raw_arr = []; - $parent = (($s['parent_mid'] && $s['parent_mid'] === $s['mid']) ? true : false); - if ($parent) { + $raw_arr = json_decode($act->raw, true); + + // This is a zot6 packet and the raw activitypub message json + // is possibly available in the attachement. + if (array_key_exists('signed', $raw_arr) && is_array($act->obj) && is_array($act->obj['attachment'])) { + foreach($act->obj['attachment'] as $a) { + if ( + isset($a['type']) && $a['type'] === 'PropertyValue' && + isset($a['name']) && $a['name'] === 'zot.activitypub.rawmsg' && + isset($a['value']) + ) { + $zot_rawmsg = $a['value']; + break; + } + } + } + + if ($zot_rawmsg) { + set_iconfig($s, 'activitypub', 'rawmsg', $zot_rawmsg, 1); + } + else { set_iconfig($s, 'activitypub', 'rawmsg', $act->raw, 1); } + set_iconfig($s, 'activitypub', 'recips', $act->raw_recips); + $hookinfo = [ 'act' => $act, 's' => $s diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index 09e1679ac..323b0e273 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -40,6 +40,7 @@ class ActivityStreams { if (is_array($string)) { $this->data = $string; + $this->raw = json_encode($string, JSON_UNESCAPED_SLASHES); } else { $this->data = json_decode($string, true); diff --git a/Zotlabs/Lib/Permcat.php b/Zotlabs/Lib/Permcat.php index bda35a9cb..0a38ca324 100644 --- a/Zotlabs/Lib/Permcat.php +++ b/Zotlabs/Lib/Permcat.php @@ -4,7 +4,6 @@ namespace Zotlabs\Lib; use Zotlabs\Access\PermissionRoles; use Zotlabs\Access\Permissions; -use Zotlabs\Lib\Libsync; use Zotlabs\Daemon\Master; /** @@ -40,33 +39,33 @@ class Permcat { // first check role perms for a perms_connect setting - $role = get_pconfig($channel_id,'system','permissions_role'); - if($role) { + $role = get_pconfig($channel_id, 'system', 'permissions_role'); + if ($role) { $x = PermissionRoles::role_perms($role); - if($x['perms_connect']) { + if ($x['perms_connect']) { $perms = Permissions::FilledPerms($x['perms_connect']); } } // if no role perms it may be a custom role, see if there any autoperms - if(! $perms) { + if (!$perms) { $perms = Permissions::FilledAutoPerms($channel_id); } // if no autoperms it may be a custom role with manual perms - if(! $perms) { + if (!$perms) { $r = q("select channel_hash from channel where channel_id = %d", intval($channel_id) ); - if($r) { + if ($r) { $x = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'my_perms'", intval($channel_id), dbesc($r[0]['channel_hash']) ); - if($x) { - foreach($x as $xv) { + if ($x) { + foreach ($x as $xv) { $perms[$xv['k']] = intval($xv['v']); } } @@ -75,13 +74,13 @@ class Permcat { // nothing was found - create a filled permission array where all permissions are 0 - if(! $perms) { + if (!$perms) { $perms = Permissions::FilledPerms([]); } $this->permcats[] = [ 'name' => 'default', - 'localname' => t('Default','permcat'), + 'localname' => t('Default', 'permcat'), 'perms' => Permissions::Operms($perms), 'raw_perms' => $perms, 'system' => 1 @@ -89,8 +88,8 @@ class Permcat { $p = $this->load_permcats($channel_id); - if($p) { - for($x = 0; $x < count($p); $x++) { + if ($p) { + for ($x = 0; $x < count($p); $x++) { $this->permcats[] = [ 'name' => $p[$x][0], 'localname' => $p[$x][1], @@ -120,9 +119,9 @@ class Permcat { * * \e bool \b error if $name not found in permcats true */ public function fetch($name) { - if($name && $this->permcats) { - foreach($this->permcats as $permcat) { - if(strcasecmp($permcat['name'], $name) === 0) { + if ($name && $this->permcats) { + foreach ($this->permcats as $permcat) { + if (strcasecmp($permcat['name'], $name) === 0) { return $permcat; } } @@ -132,7 +131,7 @@ class Permcat { } public function load_permcats($uid) { -/* + /* $permcats = [ [ 'contributor', t('Contributor','permcat'), [ 'view_stream','view_profile','view_contacts','view_storage','view_pages', @@ -144,16 +143,16 @@ class Permcat { 'post_comments','write_wiki','post_like' ], 1 ], ]; -*/ - if($uid) { + */ + if ($uid) { $x = q("select * from pconfig where uid = %d and cat = 'permcat'", intval($uid) ); - if($x) { - foreach($x as $xv) { - $value = ((preg_match('|^a:[0-9]+:{.*}$|s', $xv['v'])) ? unserialize($xv['v']) : $xv['v']); - $permcats[] = [ $xv['k'], $xv['k'], $value, 0 ]; + if ($x) { + foreach ($x as $xv) { + $value = ((preg_match('|^a:[0-9]+:{.*}$|s', $xv['v'])) ? unserialize($xv['v']) : $xv['v']); + $permcats[] = [$xv['k'], $xv['k'], $value, 0]; } } } @@ -168,11 +167,11 @@ class Permcat { } static public function find_permcat($arr, $name) { - if((! $arr) || (! $name)) + if ((!$arr) || (!$name)) return false; - foreach($arr as $p) - if($p['name'] == $name) + foreach ($arr as $p) + if ($p['name'] == $name) return $p['value']; } @@ -187,23 +186,23 @@ class Permcat { /** * @brief assign a contact role to contacts * - * @param int $channel_id + * @param array $channel * @param string $role the name of the role * @param array $contacts an array of contact hashes */ public static function assign($channel, $role, $contacts) { - if(!isset($channel['channel_id'])) { + if (!isset($channel['channel_id'])) { return; } - if(!is_array($contacts) || empty($contacts)) { + if (!is_array($contacts) || empty($contacts)) { return; } - if(!$role) { + if (!$role) { // lookup the default - $role = get_pconfig($channel_id, 'system', 'default_permcat', 'default'); + $role = get_pconfig($channel['channel_id'], 'system', 'default_permcat', 'default'); } @@ -231,10 +230,10 @@ class Permcat { foreach ($contacts as $contact) { foreach ($all_perms as $perm => $desc) { if (array_key_exists($perm, $perms)) { - $values_sql .= " (" . intval($channel['channel_id']) . ", " . protect_sprintf($contact) . ", 'my_perms', '" . dbesc($perm) . "', " . intval($perms[$perm]) . "),"; + $values_sql .= " (" . intval($channel['channel_id']) . ", " . protect_sprintf($contact) . ", 'my_perms', '" . dbesc($perm) . "', " . intval($perms[$perm]) . "),"; } else { - $values_sql .= " (" . intval($channel['channel_id']) . ", " . protect_sprintf($contact) . ", 'my_perms', '" . dbesc($perm) . "', 0), "; + $values_sql .= " (" . intval($channel['channel_id']) . ", " . protect_sprintf($contact) . ", 'my_perms', '" . dbesc($perm) . "', 0), "; } } } diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 00095187d..f6e3ab12b 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -340,10 +340,13 @@ class Site { $discover_tab = (1 - $discover_tab); $perm_roles = \Zotlabs\Access\PermissionRoles::channel_roles(); - $default_role = get_config('system','default_permissions_role','personal'); + $default_role = get_config('system', 'default_permissions_role', 'personal'); - $role = array('permissions_role' , t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'),$perm_roles); + if (!in_array($default_role, array_keys($perm_roles))) { + $default_role = 'personal'; + } + $role = array('permissions_role' , t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'),$perm_roles); $homelogin = get_config('system','login_on_homepage'); $enable_context_help = get_config('system','enable_context_help'); diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php index 8be5bba88..d42e45beb 100644 --- a/Zotlabs/Module/Permcats.php +++ b/Zotlabs/Module/Permcats.php @@ -3,35 +3,38 @@ namespace Zotlabs\Module; use App; +use Zotlabs\Access\PermissionLimits; +use Zotlabs\Access\Permissions; use Zotlabs\Web\Controller; -use Zotlabs\Lib\Apps; use Zotlabs\Lib\Libsync; use Zotlabs\Lib\AccessList; +use Zotlabs\Lib\Permcat; class Permcats extends Controller { function post() { - if(! local_channel()) + if (!local_channel()) return; $channel = App::get_channel(); check_form_security_token_redirectOnErr('/permcats', 'permcats'); - $name = escape_tags(trim($_REQUEST['name'])); + $name = escape_tags(trim($_REQUEST['name'])); $is_system_role = isset($_REQUEST['is_system_role']); - $return_path = z_root() . '/permcats/' . $_REQUEST['return_path']; - $group_hash = $_REQUEST['group_select'] ?? ''; - $deleted_role = $_REQUEST['deleted_role'] ?? ''; - $new_role = $_REQUEST['new_role'] ?? ''; - $contacts = []; + $return_path = z_root() . '/permcats/' . $_REQUEST['return_path']; + $group_hash = $_REQUEST['group_select'] ?? ''; + $deleted_role = $_REQUEST['deleted_role'] ?? ''; + $new_role = $_REQUEST['new_role'] ?? ''; + $contacts = []; + if (argv(1) && hex2bin(argv(1)) !== $name) { $return_path = z_root() . '/permcats/' . bin2hex($name); } - if($deleted_role && $new_role) { + if ($deleted_role && $new_role) { $r = q("SELECT abook_xchan FROM abook WHERE abook_channel = %d AND abook_role = '%s' AND abook_self = 0 AND abook_pending = 0", intval(local_channel()), dbesc($deleted_role) @@ -42,13 +45,13 @@ class Permcats extends Controller { } if ($contacts) { - \Zotlabs\Lib\Permcat::assign($channel, $new_role, $contacts); + Permcat::assign($channel, $new_role, $contacts); } - \Zotlabs\Lib\Permcat::delete(local_channel(), $deleted_role); + Permcat::delete(local_channel(), $deleted_role); $default_role = get_pconfig(local_channel(), 'system', 'default_permcat', 'default'); - if($deleted_role === $default_role) { + if ($deleted_role === $default_role) { set_pconfig(local_channel(), 'system', 'default_permcat', $new_role); } @@ -70,6 +73,7 @@ class Permcats extends Controller { } } + $group = null; if (!$contacts && $group_hash) { $group = AccessList::by_hash(local_channel(), $group_hash); } @@ -78,8 +82,8 @@ class Permcats extends Controller { $contacts = AccessList::members_xchan(local_channel(), $group['id']); } - if(! $name ) { - notice( t('Permission category name is required.') . EOL); + if (!$name) { + notice(t('Permission category name is required.') . EOL); return; } @@ -92,35 +96,62 @@ class Permcats extends Controller { if ($is_system_role) { // if we have a system role just set the default and assign if aplicable and be done with it if ($contacts) { - \Zotlabs\Lib\Permcat::assign($channel, $name, $contacts); + Permcat::assign($channel, $name, $contacts); } - info( t('Contact role saved.') . EOL); + info(t('Contact role saved.') . EOL); Libsync::build_sync_packet(); goaway($return_path); return; } - $pcarr = []; - $all_perms = \Zotlabs\Access\Permissions::Perms(); + $pcarr = []; + $all_perms = Permissions::Perms(); - if($all_perms) { - foreach($all_perms as $perm => $desc) { - if(array_key_exists('perms_' . $perm, $_POST)) { + if ($all_perms) { + foreach ($all_perms as $perm => $desc) { + if (array_key_exists('perms_' . $perm, $_POST)) { $pcarr[] = $perm; } } } - \Zotlabs\Lib\Permcat::update(local_channel(), $name, $pcarr); + $pcat = new Permcat(local_channel()); + $pcatlist = $pcat->listing(); + $existing_raw_perms = []; + + if ($pcatlist) { + foreach ($pcatlist as $pc) { + if ($pc['name'] && ($pc['name'] === $name)) { + $existing_raw_perms = $pc['raw_perms']; + } + } + } + + if (!$contacts && array_diff_assoc($existing_raw_perms, Permissions::FilledPerms($pcarr))) { + // If we don't have anyone to assign the role to and an existing role has changed, + // we will re-assign the changed role to all its members if there are any. + + $r = q("SELECT abook_xchan FROM abook WHERE abook_channel = %d AND abook_role = '%s' AND abook_self = 0 AND abook_pending = 0", + intval(local_channel()), + dbesc($name) + ); + + if ($r) { + $contacts = ids_to_array($r, 'abook_xchan'); + } + + } + + Permcat::update(local_channel(), $name, $pcarr); if ($contacts) { - \Zotlabs\Lib\Permcat::assign($channel, $name, $contacts); + Permcat::assign($channel, $name, $contacts); } Libsync::build_sync_packet(); - info( t('Contact role saved.') . EOL); + info(t('Contact role saved.') . EOL); goaway($return_path); return; @@ -129,35 +160,34 @@ class Permcats extends Controller { function get() { - if(! local_channel()) - return; + if (!local_channel()) + return EMPTY_STR; nav_set_selected('Contact Roles'); - $channel = App::get_channel(); - - if(argc() > 1) { + $name = ''; + if (argc() > 1) { $name = hex2bin(argv(1)); } - $existing = []; - - $pcat = new \Zotlabs\Lib\Permcat(local_channel()); - $pcatlist = $pcat->listing(); - - $is_system_role = false; + $perms = []; + $existing = []; + $pcat = new Permcat(local_channel()); + $pcatlist = $pcat->listing(); + $is_system_role = false; $delete_role_select_options = []; - $is_default_role = (get_pconfig(local_channel(),'system','default_permcat','default') === $name); + $is_default_role = (get_pconfig(local_channel(), 'system', 'default_permcat', 'default') === $name); + $localname = ''; - if($pcatlist) { - foreach($pcatlist as $pc) { - if(($pc['name']) && ($name) && ($pc['name'] == $name)) { + if ($pcatlist) { + foreach ($pcatlist as $pc) { + if ($pc['name'] && $name && ($pc['name'] === $name)) { $existing = $pc['perms']; if (isset($pc['system']) && intval($pc['system'])) $is_system_role = $pc['name']; } - if($pc['name'] == $name) { + if ($pc['name'] == $name) { $localname = $pc['localname']; } @@ -177,13 +207,13 @@ class Permcats extends Controller { $delete_role_select_options ]; - $global_perms = \Zotlabs\Access\Permissions::Perms(); + $global_perms = Permissions::Perms(); - foreach($global_perms as $k => $v) { - $thisperm = \Zotlabs\Lib\Permcat::find_permcat($existing,$k); - $checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k); + foreach ($global_perms as $k => $v) { + $thisperm = Permcat::find_permcat($existing, $k); + $checkinherited = PermissionLimits::Get(local_channel(), $k); - if($existing[$k]) + if ($existing[$k]) $thisperm = 1; $perms[] = [ @@ -198,14 +228,13 @@ class Permcats extends Controller { ]; } - $group_select_options = [ 'selected' => '', - 'form_id' => 'group_select', - 'label' => t('Assign this role to'), - 'after' => [ - 'name' => t('All my contacts'), - 'id' => 'all_contacts', + 'form_id' => 'group_select', + 'label' => t('Assign this role to'), + 'after' => [ + 'name' => t('All my contacts'), + 'id' => 'all_contacts', 'selected' => false ] ]; @@ -213,25 +242,25 @@ class Permcats extends Controller { $group_select = AccessList::select(local_channel(), $group_select_options); $tpl = get_markup_template("permcats.tpl"); - $o .= replace_macros($tpl, array( + $o = replace_macros($tpl, [ '$form_security_token' => get_form_security_token("permcats"), - '$default_role' => array('default_role', t('Automatically assign this role to new contacts'), intval($is_default_role), '', [t('No'), t('Yes')]), - '$title' => t('Contact Roles'), - '$name' => ['name', t('Role name') . ' <span class="required">*</span>', (($localname) ? $localname : ''), (($is_system_role) ? t('System role - not editable') : '') , '', (($is_system_role) ? 'disabled' : '')], - '$delete_label' => t('Deleting') . ' ' . $localname, - '$current_role' => $name, - '$perms' => $perms, - '$inherited' => t('inherited'), - '$is_system_role' => $is_system_role, - '$permlbl' => t('Role Permissions'), - '$permnote' => t('Some permissions may be inherited from your <a href="settings">channel role</a>, which have higher priority than contact role settings.'), - '$submit' => t('Submit'), - '$return_path' => argv(1), - '$group_select' => $group_select, - '$delete_role_select' => $delete_role_select, - '$delet_role_button' => t('Delete') - - )); + '$default_role' => ['default_role', t('Automatically assign this role to new contacts'), intval($is_default_role), '', [t('No'), t('Yes')]], + '$title' => t('Contact Roles'), + '$name' => ['name', t('Role name') . ' <span class="required">*</span>', (($localname) ? $localname : ''), (($is_system_role) ? t('System role - not editable') : ''), '', (($is_system_role) ? 'disabled' : '')], + '$delete_label' => t('Deleting') . ' ' . $localname, + '$current_role' => $name, + '$perms' => $perms, + '$inherited' => t('inherited'), + '$is_system_role' => $is_system_role, + '$permlbl' => t('Role Permissions'), + '$permnote' => t('Some permissions may be inherited from your <a href="settings">channel role</a>, which have higher priority than contact role settings.'), + '$submit' => t('Submit'), + '$return_path' => argv(1), + '$group_select' => $group_select, + '$delete_role_select' => $delete_role_select, + '$delet_role_button' => t('Delete') + ]); + return $o; } diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php index 43102f006..6d0e78587 100644 --- a/Zotlabs/Module/Wfinger.php +++ b/Zotlabs/Module/Wfinger.php @@ -126,7 +126,7 @@ class Wfinger extends \Zotlabs\Web\Controller { 'http://webfinger.net/ns/name' => $r['channel_name'], 'http://xmlns.com/foaf/0.1/name' => $r['channel_name'], 'https://w3id.org/security/v1#publicKeyPem' => $r['xchan_pubkey'], - 'http://purl.org/zot/federation' => 'zot6,zot' + 'http://purl.org/zot/federation' => 'zot6' ]; foreach($aliases as $alias) @@ -184,12 +184,6 @@ class Wfinger extends \Zotlabs\Web\Controller { ], [ - 'rel' => 'http://schemas.google.com/g/2010#updates-from', - 'type' => 'application/atom+xml', - 'href' => z_root() . '/ofeed/' . $r['channel_address'] - ], - - [ 'rel' => 'http://webfinger.net/rel/blog', 'href' => z_root() . '/channel/' . $r['channel_address'], ], @@ -206,11 +200,6 @@ class Wfinger extends \Zotlabs\Web\Controller { ], [ - 'rel' => 'http://purl.org/zot/protocol', - 'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r['xchan_addr'], - ], - - [ 'rel' => 'http://purl.org/openwebauth/v1', 'type' => 'application/x-zot+json', 'href' => z_root() . '/owa', diff --git a/Zotlabs/Update/_1252.php b/Zotlabs/Update/_1252.php new file mode 100644 index 000000000..97bb58d9d --- /dev/null +++ b/Zotlabs/Update/_1252.php @@ -0,0 +1,23 @@ +<?php + +namespace Zotlabs\Update; + +class _1252 { + + function run() { + + dbq("START TRANSACTION"); + + $r = dbq("DELETE FROM app WHERE app_plugin = 'mail' AND app_system = 1"); + + if($r) { + dbq("COMMIT"); + return UPDATE_SUCCESS; + } + + dbq("ROLLBACK"); + return UPDATE_FAILED; + + } + +} |