/** * Returns new user password proposal * * @return string */ function zb_RegPasswordProposal() { $alterconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini"); if (isset($alterconf['PASSWORD_GENERATION_LENGHT']) and isset($alterconf['PASSWORD_TYPE'])) { if ($alterconf['PASSWORD_TYPE']) { $password = zb_rand_string($alterconf['PASSWORD_GENERATION_LENGHT']); } else { $password = zb_rand_digits($alterconf['PASSWORD_GENERATION_LENGHT']); } } else { die(strtoupper('you have missed a essential option. before update read release notes m**********r!')); } return $password; }
/** * Returns form for editing one field string password data * * @param array $fieldnames * @param string $fieldkey * @param string $useraddress * @param string $olddata * @return string */ function web_EditorStringDataFormPassword($fieldnames, $fieldkey, $useraddress, $olddata = '') { global $ubillingConfig; $field1 = $fieldnames['fieldname1']; $field2 = $fieldnames['fieldname2']; $alterconf = $ubillingConfig->getAlter(); if (isset($alterconf['PASSWORD_GENERATION_LENGHT'])) { $password_proposal = $alterconf['PASSWORD_TYPE'] ? zb_rand_string($alterconf['PASSWORD_GENERATION_LENGHT']) : zb_rand_digits($alterconf['PASSWORD_GENERATION_LENGHT']); } else { //default size $password_proposal = zb_rand_string(8); } $cells = wf_TableCell(__('User'), '', 'row2'); $cells .= wf_TableCell($useraddress, '', 'row3'); $rows = wf_TableRow($cells); $cells = wf_TableCell($field1, '', 'row2'); $cells .= wf_TableCell($olddata, '', 'row3'); $rows .= wf_TableRow($cells); $cells = wf_TableCell($field2, '', 'row2'); $cells .= wf_TableCell(wf_TextInput($fieldkey, '', $password_proposal, false, ''), '', 'row3'); $rows .= wf_TableRow($cells); $form = wf_TableBody($rows, '100%', 0); $form .= wf_Submit(__('Change')); $form = wf_Form("", 'POST', $form, ''); $form .= wf_delimiter(); return $form; }