clean code and fix bugs (to cont.)
This commit is contained in:
parent
5b1b92fe61
commit
afe3896114
@ -907,7 +907,7 @@ INSERT INTO user_user(
|
|||||||
is_employee, is_backend_access, is_active, activation_code,
|
is_employee, is_backend_access, is_active, activation_code,
|
||||||
comment
|
comment
|
||||||
) VALUES (
|
) VALUES (
|
||||||
'Super', 'Admin', 'superadmin@localhost', 'b6f5a1d77223794fcdb86a95ea24c20476deb006',
|
'Super', 'Admin', 'admin@localhost', 'b6f5a1d77223794fcdb86a95ea24c20476deb006',
|
||||||
(SELECT id FROM core_country WHERE code='ch'),
|
(SELECT id FROM core_country WHERE code='ch'),
|
||||||
(SELECT id FROM core_currency WHERE code='chf'),
|
(SELECT id FROM core_currency WHERE code='chf'),
|
||||||
(SELECT id FROM core_lang WHERE code='en_gb'),
|
(SELECT id FROM core_lang WHERE code='en_gb'),
|
||||||
@ -930,7 +930,7 @@ INSERT INTO core_feature(model, code, url_feature_translation_id, label_feature_
|
|||||||
--feature for admin: home
|
--feature for admin: home
|
||||||
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
||||||
VALUES (
|
VALUES (
|
||||||
(SELECT id FROM user_user WHERE email='superadmin@localhost' LIMIT 1),
|
(SELECT id FROM user_user WHERE email='admin@localhost' LIMIT 1),
|
||||||
(SELECT id FROM core_feature WHERE code='home' LIMIT 1)
|
(SELECT id FROM core_feature WHERE code='home' LIMIT 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -979,7 +979,7 @@ INSERT INTO core_feature (
|
|||||||
--feature for admin
|
--feature for admin
|
||||||
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
||||||
VALUES (
|
VALUES (
|
||||||
(SELECT id FROM user_user WHERE email='superadmin@localhost' LIMIT 1),
|
(SELECT id FROM user_user WHERE email='admin@localhost' LIMIT 1),
|
||||||
(SELECT id FROM core_feature WHERE code='my-profile' LIMIT 1)
|
(SELECT id FROM core_feature WHERE code='my-profile' LIMIT 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -996,7 +996,7 @@ INSERT INTO core_feature (model, code, url_feature_translation_id, label_feature
|
|||||||
--feature for admin: logout
|
--feature for admin: logout
|
||||||
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
||||||
VALUES (
|
VALUES (
|
||||||
(SELECT id FROM user_user WHERE email='superadmin@localhost' LIMIT 1),
|
(SELECT id FROM user_user WHERE email='admin@localhost' LIMIT 1),
|
||||||
(SELECT id FROM core_feature WHERE code='logout' LIMIT 1)
|
(SELECT id FROM core_feature WHERE code='logout' LIMIT 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1063,7 +1063,7 @@ INSERT INTO core_feature (
|
|||||||
--rule for admin
|
--rule for admin
|
||||||
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
||||||
VALUES (
|
VALUES (
|
||||||
(SELECT id FROM user_user WHERE email='superadmin@localhost' LIMIT 1),
|
(SELECT id FROM user_user WHERE email='admin@localhost' LIMIT 1),
|
||||||
(SELECT id FROM core_feature WHERE code='list-translations' LIMIT 1)
|
(SELECT id FROM core_feature WHERE code='list-translations' LIMIT 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1080,7 +1080,7 @@ INSERT INTO core_feature (model, code, url_feature_translation_id, label_feature
|
|||||||
--rule for admin
|
--rule for admin
|
||||||
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
INSERT INTO useruser_corefeature_rel(user_id, core_feature_id)
|
||||||
VALUES (
|
VALUES (
|
||||||
(SELECT id FROM user_user WHERE email='superadmin@localhost' LIMIT 1),
|
(SELECT id FROM user_user WHERE email='admin@localhost' LIMIT 1),
|
||||||
(SELECT id FROM core_feature WHERE code='edit-translation' LIMIT 1)
|
(SELECT id FROM core_feature WHERE code='edit-translation' LIMIT 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -15,21 +15,10 @@ if(isset($_POST['formLoginButtonSubmit'])){
|
|||||||
|
|
||||||
if(isset($_POST['submit_change_password'])){
|
if(isset($_POST['submit_change_password'])){
|
||||||
// Open connection with Globsi Backend
|
// Open connection with Globsi Backend
|
||||||
$url = $_SESSION['erp']['url'];
|
|
||||||
$db = $_SESSION['erp']['db'];
|
|
||||||
$username = $_SESSION['erp']['admin_user'];
|
|
||||||
$password = $_SESSION['erp']['admin_password'];
|
|
||||||
$user_connection = new ClassXMLRPC($url, $db, $username, $password);
|
|
||||||
|
|
||||||
$common = ripcord::client($url."xmlrpc/2/common");
|
|
||||||
$uid = $common->authenticate($db, $username, $password, array());
|
|
||||||
$models = ripcord::client($url."xmlrpc/2/object");
|
|
||||||
|
|
||||||
$userPassword = $oUser->changePassword($_SESSION['user']['id'], $_POST);
|
$userPassword = $oUser->changePassword($_SESSION['user']['id'], $_POST);
|
||||||
if($userPassword['state']=="success"){
|
if($userPassword['state']=="success"){
|
||||||
$getUser = $oUser->getUser($_SESSION['user']['id']);
|
$getUser = $oUser->getUser($_SESSION['user']['id']);
|
||||||
if(isset($getUser['password'])){
|
if(isset($getUser['password'])){
|
||||||
$res = $models->execute_kw($db, $uid, $password, 'res.users', 'write', array(array($_SESSION['user']['ext_id']), array('password'=>$getUser['password'])));
|
|
||||||
unset($_SESSION);
|
unset($_SESSION);
|
||||||
header("Location:".$oConf->getURLRoot('scripts/logout.php'));
|
header("Location:".$oConf->getURLRoot('scripts/logout.php'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user