Skip to content

Commit

Permalink
force in to fix fail to save user preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
antonraharja committed Sep 20, 2014
1 parent 6c7dacd commit 8d8306d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion db/playsms-upgrade-0992-to-100.sql
Expand Up @@ -101,7 +101,7 @@ UPDATE `playsms_tblRegistry` SET `registry_value` = '1.0-beta4' WHERE `registry_
-- core config
UPDATE `playsms_tblRegistry` SET `registry_value` = '1.0-beta5' WHERE `registry_group` = 'core' AND `registry_family` = 'config' AND `registry_key` = 'playsms_version' ;

ALTER TABLE `playsms_tblUser` ADD `parent_uid` INT NOT NULL AFTER `c_timestamp`;
ALTER TABLE `playsms_tblUser` ADD `parent_uid` INT(11) NOT NULL DEFAULT '0' AFTER `c_timestamp`;

--
-- Table structure for table `playsms_featureCredit`
Expand Down
8 changes: 4 additions & 4 deletions web/plugin/core/user/user_pref.php
Expand Up @@ -71,10 +71,10 @@
'username' => $c_username
))) {
if ($allow_edit_status) {
$status = $c_user[0]['status'];
$status = (int) $c_user[0]['status'];
}
if ($allow_edit_parent) {
$parent_uid = $c_user[0]['parent_uid'];
$parent_uid = (int) $c_user[0]['parent_uid'];
}
$name = $c_user[0]['name'];
$email = $c_user[0]['email'];
Expand Down Expand Up @@ -249,9 +249,9 @@

// subuser's parent uid, by default its uid=1
if ($_POST['up_parent_uid']) {
$up['parent_uid'] = ($user_edited['status'] == 4 ? $_POST['up_parent_uid'] : 1);
$up['parent_uid'] = (int) ($user_edited['status'] == 4 ? $_POST['up_parent_uid'] : 1);
} else {
$up['parent_uid'] = user_getparentbyuid(user_username2uid($c_username));
$up['parent_uid'] = (int) user_getparentbyuid(user_username2uid($c_username));
}

$up['username'] = $c_username;
Expand Down

0 comments on commit 8d8306d

Please sign in to comment.