- Added function to create random passwords in auth library.
- Fixed {RECORDID} placeholder in SQL datasource strings.
| | |
| | | } |
| | | } |
| | | |
| | | public function get_random_password($length = 8) { |
| | | $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
| | | $password = ''; |
| | | for ($n=0;$n<$length;$n++) { |
| | | $password.=$base64_alphabet[mt_rand(0,63)]; |
| | | } |
| | | return $password; |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
| | |
| | | global $conf, $app; |
| | | if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab does not exist or the tab is empty (TAB: $tab)."); |
| | | $new_record = ''; |
| | | $table_idx = $this->formDef['db_table_idx']; |
| | | if(isset($record[$table_idx])) $new_record[$table_idx] = intval($record[$table_idx ]); |
| | | |
| | | if(is_array($record)) { |
| | | foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) { |
| | | switch ($field['datatype']) { |
| | |
| | | $table_idx = $this->formDef['db_table_idx']; |
| | | |
| | | $tmp_recordid = (isset($record[$table_idx]))?$record[$table_idx]:0; |
| | | //$tmp_recordid = intval($this->primary_id); |
| | | $querystring = str_replace("{RECORDID}",$tmp_recordid,$querystring); |
| | | unset($tmp_recordid); |
| | | |