@@ -568,8 +568,8 @@ |
||
568 | 568 | $parameters = array(); |
569 | 569 | $reshook = $hookmanager->executeHooks('beforeLoginAuthentication', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
570 | 570 | if ($reshook < 0) { |
571 | - $test = false; |
|
572 | - $error++; |
|
571 | + $test = false; |
|
572 | + $error++; |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | // Verification security graphic code |
@@ -380,9 +380,9 @@ discard block |
||
380 | 380 | 'e.phone'=>'(+33)(0)123456789', |
381 | 381 | 'e.fax'=>'(+33)(0)123456790', |
382 | 382 | 'e.statut'=>'1', |
383 | - 'e.fk_parent'=>'id or ref of warehouse' |
|
384 | - ); |
|
385 | - $this->import_updatekeys_array[$r] = array('p.ref'=>'Ref'); |
|
383 | + 'e.fk_parent'=>'id or ref of warehouse' |
|
384 | + ); |
|
385 | + $this->import_updatekeys_array[$r] = array('p.ref'=>'Ref'); |
|
386 | 386 | |
387 | 387 | // Import stocks |
388 | 388 | $r++; |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | 'ps.fk_entrepot'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/stock/class/entrepot.class.php', 'class'=>'Entrepot', 'method'=>'fetch', 'element'=>'ref') |
399 | 399 | ); |
400 | 400 | $this->import_examplevalues_array[$r] = array( |
401 | - 'ps.fk_product'=>"id or ref of product", 'ps.fk_entrepot'=>"id or ref of warehouse", 'ps.reel'=>"10" |
|
401 | + 'ps.fk_product'=>"id or ref of product", 'ps.fk_entrepot'=>"id or ref of warehouse", 'ps.reel'=>"10" |
|
402 | 402 | ); |
403 | 403 | $this->import_updatekeys_array[$r] = array('ps.fk_product'=>'Product', 'ps.fk_entrepot'=>"Warehouse"); |
404 | 404 | $this->import_run_sql_after_array[$r] = array( // Because we may change data that are denormalized, we must update dernormalized data after. |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | 'subscription' => 'payment', |
55 | 55 | 'payment' => 'payment', |
56 | 56 | 'tax' => 'generic', |
57 | - 'tax_type' => 'generic', |
|
58 | - 'other' => 'generic', |
|
57 | + 'tax_type' => 'generic', |
|
58 | + 'other' => 'generic', |
|
59 | 59 | 'account' => 'account', |
60 | 60 | 'product' => 'product', |
61 | 61 | 'virtualproduct'=>'product', |
62 | 62 | 'subproduct' => 'product', |
63 | 63 | 'product_supplier_ref' => 'product', |
64 | - 'stock' => 'stock', |
|
64 | + 'stock' => 'stock', |
|
65 | 65 | 'warehouse' => 'stock', |
66 | 66 | 'batch' => 'stock', |
67 | 67 | 'stockbatch' => 'stock', |
@@ -505,14 +505,14 @@ discard block |
||
505 | 505 | print $objexport->array_export_module[0]->getName(); |
506 | 506 | print '</td></tr>'; |
507 | 507 | |
508 | - // Lot de donnees a exporter |
|
509 | - print '<tr><td>'.$langs->trans("DatasetToExport").'</td>'; |
|
510 | - print '<td>'; |
|
511 | - $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); |
|
512 | - $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity); |
|
513 | - print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; |
|
514 | - print $objexport->array_export_label[0]; |
|
515 | - print '</td></tr>'; |
|
508 | + // Lot de donnees a exporter |
|
509 | + print '<tr><td>'.$langs->trans("DatasetToExport").'</td>'; |
|
510 | + print '<td>'; |
|
511 | + $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); |
|
512 | + $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity); |
|
513 | + print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; |
|
514 | + print $objexport->array_export_label[0]; |
|
515 | + print '</td></tr>'; |
|
516 | 516 | |
517 | 517 | print '</table>'; |
518 | 518 | print '</div>'; |
@@ -888,14 +888,14 @@ discard block |
||
888 | 888 | print $objexport->array_export_module[0]->getName(); |
889 | 889 | print '</td></tr>'; |
890 | 890 | |
891 | - // Lot de donnees a exporter |
|
892 | - print '<tr><td>'.$langs->trans("DatasetToExport").'</td>'; |
|
893 | - print '<td>'; |
|
891 | + // Lot de donnees a exporter |
|
892 | + print '<tr><td>'.$langs->trans("DatasetToExport").'</td>'; |
|
893 | + print '<td>'; |
|
894 | 894 | $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); |
895 | 895 | $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity); |
896 | - print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; |
|
897 | - print $objexport->array_export_label[0]; |
|
898 | - print '</td></tr>'; |
|
896 | + print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; |
|
897 | + print $objexport->array_export_label[0]; |
|
898 | + print '</td></tr>'; |
|
899 | 899 | |
900 | 900 | // List of exported fields |
901 | 901 | print '<tr><td>'.$langs->trans("ExportedFields").'</td>'; |
@@ -1156,14 +1156,14 @@ discard block |
||
1156 | 1156 | print $objexport->array_export_module[0]->getName(); |
1157 | 1157 | print '</td></tr>'; |
1158 | 1158 | |
1159 | - // Dataset to export |
|
1160 | - print '<tr><td>'.$langs->trans("DatasetToExport").'</td>'; |
|
1161 | - print '<td>'; |
|
1162 | - $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); |
|
1163 | - $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity); |
|
1164 | - print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; |
|
1165 | - print $objexport->array_export_label[0]; |
|
1166 | - print '</td></tr>'; |
|
1159 | + // Dataset to export |
|
1160 | + print '<tr><td>'.$langs->trans("DatasetToExport").'</td>'; |
|
1161 | + print '<td>'; |
|
1162 | + $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); |
|
1163 | + $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity); |
|
1164 | + print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; |
|
1165 | + print $objexport->array_export_label[0]; |
|
1166 | + print '</td></tr>'; |
|
1167 | 1167 | |
1168 | 1168 | // List of exported fields |
1169 | 1169 | print '<tr><td>'.$langs->trans("ExportedFields").'</td>'; |
@@ -67,96 +67,96 @@ |
||
67 | 67 | $parameters = array('username' => $username); |
68 | 68 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
69 | 69 | if ($reshook < 0) { |
70 | - $message = $hookmanager->error; |
|
70 | + $message = $hookmanager->error; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if (empty($reshook)) { |
74 | - // Validate new password |
|
75 | - if ($action == 'validatenewpassword' && $username && $passwordhash) |
|
76 | - { |
|
77 | - $edituser = new User($db); |
|
78 | - $result = $edituser->fetch('', $_GET["username"]); |
|
79 | - if ($result < 0) |
|
80 | - { |
|
81 | - $message = '<div class="error">'.dol_escape_htmltag($langs->trans("ErrorLoginDoesNotExists", $username)).'</div>'; |
|
82 | - } else { |
|
83 | - if (dol_verifyHash($edituser->pass_temp, $passwordhash)) |
|
84 | - { |
|
85 | - // Clear session |
|
86 | - unset($_SESSION['dol_login']); |
|
87 | - $_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page |
|
88 | - |
|
89 | - $newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0); |
|
90 | - dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database"); |
|
91 | - header("Location: ".DOL_URL_ROOT.'/'); |
|
92 | - exit; |
|
93 | - } else { |
|
94 | - $langs->load("errors"); |
|
95 | - $message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>'; |
|
96 | - } |
|
97 | - } |
|
98 | - } |
|
99 | - // Action modif mot de passe |
|
100 | - if ($action == 'buildnewpassword' && $username) |
|
101 | - { |
|
102 | - $sessionkey = 'dol_antispam_value'; |
|
103 | - $ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); |
|
104 | - |
|
105 | - // Verify code |
|
106 | - if (!$ok) |
|
107 | - { |
|
108 | - $message = '<div class="error">'.$langs->trans("ErrorBadValueForCode").'</div>'; |
|
109 | - } else { |
|
110 | - $isanemail = preg_match('/@/', $username); |
|
111 | - |
|
112 | - $edituser = new User($db); |
|
113 | - $result = $edituser->fetch('', $username, '', 1); |
|
114 | - if ($result == 0 && $isanemail) |
|
115 | - { |
|
116 | - $result = $edituser->fetch('', '', '', 1, -1, $username); |
|
117 | - } |
|
118 | - |
|
119 | - if ($result <= 0 && $edituser->error == 'USERNOTFOUND') |
|
120 | - { |
|
121 | - $message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">'; |
|
122 | - if (!$isanemail) { |
|
123 | - $message .= $langs->trans("IfLoginExistPasswordRequestSent"); |
|
124 | - } else { |
|
125 | - $message .= $langs->trans("IfEmailExistPasswordRequestSent"); |
|
126 | - } |
|
127 | - $message .= '</div>'; |
|
128 | - $username = ''; |
|
129 | - } else { |
|
130 | - if (!$edituser->email) |
|
131 | - { |
|
132 | - $message = '<div class="error">'.$langs->trans("ErrorLoginHasNoEmail").'</div>'; |
|
133 | - } else { |
|
134 | - $newpassword = $edituser->setPassword($user, '', 1); |
|
135 | - if ($newpassword < 0) |
|
136 | - { |
|
137 | - // Failed |
|
138 | - $message = '<div class="error">'.$langs->trans("ErrorFailedToChangePassword").'</div>'; |
|
139 | - } else { |
|
140 | - // Success |
|
141 | - if ($edituser->send_password($user, $newpassword, 1) > 0) |
|
142 | - { |
|
143 | - $message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">'; |
|
144 | - if (!$isanemail) { |
|
145 | - $message .= $langs->trans("IfLoginExistPasswordRequestSent"); |
|
146 | - } else { |
|
147 | - $message .= $langs->trans("IfEmailExistPasswordRequestSent"); |
|
148 | - } |
|
149 | - //$message .= $langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email)); |
|
150 | - $message .= '</div>'; |
|
151 | - $username = ''; |
|
152 | - } else { |
|
153 | - $message .= '<div class="error">'.$edituser->error.'</div>'; |
|
154 | - } |
|
155 | - } |
|
156 | - } |
|
157 | - } |
|
158 | - } |
|
159 | - } |
|
74 | + // Validate new password |
|
75 | + if ($action == 'validatenewpassword' && $username && $passwordhash) |
|
76 | + { |
|
77 | + $edituser = new User($db); |
|
78 | + $result = $edituser->fetch('', $_GET["username"]); |
|
79 | + if ($result < 0) |
|
80 | + { |
|
81 | + $message = '<div class="error">'.dol_escape_htmltag($langs->trans("ErrorLoginDoesNotExists", $username)).'</div>'; |
|
82 | + } else { |
|
83 | + if (dol_verifyHash($edituser->pass_temp, $passwordhash)) |
|
84 | + { |
|
85 | + // Clear session |
|
86 | + unset($_SESSION['dol_login']); |
|
87 | + $_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page |
|
88 | + |
|
89 | + $newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0); |
|
90 | + dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database"); |
|
91 | + header("Location: ".DOL_URL_ROOT.'/'); |
|
92 | + exit; |
|
93 | + } else { |
|
94 | + $langs->load("errors"); |
|
95 | + $message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>'; |
|
96 | + } |
|
97 | + } |
|
98 | + } |
|
99 | + // Action modif mot de passe |
|
100 | + if ($action == 'buildnewpassword' && $username) |
|
101 | + { |
|
102 | + $sessionkey = 'dol_antispam_value'; |
|
103 | + $ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); |
|
104 | + |
|
105 | + // Verify code |
|
106 | + if (!$ok) |
|
107 | + { |
|
108 | + $message = '<div class="error">'.$langs->trans("ErrorBadValueForCode").'</div>'; |
|
109 | + } else { |
|
110 | + $isanemail = preg_match('/@/', $username); |
|
111 | + |
|
112 | + $edituser = new User($db); |
|
113 | + $result = $edituser->fetch('', $username, '', 1); |
|
114 | + if ($result == 0 && $isanemail) |
|
115 | + { |
|
116 | + $result = $edituser->fetch('', '', '', 1, -1, $username); |
|
117 | + } |
|
118 | + |
|
119 | + if ($result <= 0 && $edituser->error == 'USERNOTFOUND') |
|
120 | + { |
|
121 | + $message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">'; |
|
122 | + if (!$isanemail) { |
|
123 | + $message .= $langs->trans("IfLoginExistPasswordRequestSent"); |
|
124 | + } else { |
|
125 | + $message .= $langs->trans("IfEmailExistPasswordRequestSent"); |
|
126 | + } |
|
127 | + $message .= '</div>'; |
|
128 | + $username = ''; |
|
129 | + } else { |
|
130 | + if (!$edituser->email) |
|
131 | + { |
|
132 | + $message = '<div class="error">'.$langs->trans("ErrorLoginHasNoEmail").'</div>'; |
|
133 | + } else { |
|
134 | + $newpassword = $edituser->setPassword($user, '', 1); |
|
135 | + if ($newpassword < 0) |
|
136 | + { |
|
137 | + // Failed |
|
138 | + $message = '<div class="error">'.$langs->trans("ErrorFailedToChangePassword").'</div>'; |
|
139 | + } else { |
|
140 | + // Success |
|
141 | + if ($edituser->send_password($user, $newpassword, 1) > 0) |
|
142 | + { |
|
143 | + $message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">'; |
|
144 | + if (!$isanemail) { |
|
145 | + $message .= $langs->trans("IfLoginExistPasswordRequestSent"); |
|
146 | + } else { |
|
147 | + $message .= $langs->trans("IfEmailExistPasswordRequestSent"); |
|
148 | + } |
|
149 | + //$message .= $langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email)); |
|
150 | + $message .= '</div>'; |
|
151 | + $username = ''; |
|
152 | + } else { |
|
153 | + $message .= '<div class="error">'.$edituser->error.'</div>'; |
|
154 | + } |
|
155 | + } |
|
156 | + } |
|
157 | + } |
|
158 | + } |
|
159 | + } |
|
160 | 160 | } |
161 | 161 | |
162 | 162 |