예제 #1
0
     $default_parent_uid = $parent_uid && $parent['uid'] == $user_edited['parent_uid'] ? $parent['uid'] : $core_config['main']['default_parent'];
     $select_parents = themes_select_account_level_single(3, 'add_parent_uid', $default_parent_uid);
     if ($view == 'admin') {
         $selected_admin = 'selected';
     } else {
         if ($view == 'users') {
             $selected_users = 'selected';
         } else {
             if ($view == 'subusers') {
                 $selected_subusers = 'selected';
             }
         }
     }
     $option_status = "\n\t\t\t<option value='2' " . $selected_admin . ">" . _('Administrator') . "</option>\n\t\t\t<option value='3' " . $selected_users . ">" . _('User') . "</option>\n\t\t\t<option value='4' " . $selected_subusers . ">" . _('Subuser') . "</option>\n\t\t";
     // get access control list
     $option_acl = _select('add_acl_id', array_flip(acl_getall()));
     $content .= "\n\t\t<h2>" . _('Manage account') . "</h2>\n\t\t<h3>" . _('Add account') . "</h3>\n\t\t<form action='index.php?app=main&inc=core_user&route=user_mgmnt&op=user_add_yes&view=" . $view . "' method=POST>\n\t\t" . _CSRF_FORM_ . "\n\t\t<table class=playsms-table>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td class=label-sizer>" . _('Account status') . "</td><td><select name='add_status'>{$option_status}</select></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Access Control List') . "</td><td>" . $option_acl . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Parent account') . " (" . _('for subuser only') . ") </td><td>" . $select_parents . " " . _hint(_('Parent account is mandatory for subusers only. If no value is given then the subuser will be automatically assigned to user admin')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Username')) . "</td><td><input type='text' maxlength='30' name='add_username' value=\"{$add_username}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Password')) . "</td><td><input type='password' maxlength='30' name='add_password' value=\"{$add_password}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Full name')) . "</td><td><input type='text' maxlength='100' name='add_name' value=\"{$add_name}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Email')) . "</td><td><input type='text' maxlength='250' name='add_email' value=\"{$add_email}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Mobile') . "</td><td><input type='text' size='16' maxlength='16' name='add_mobile' value=\"{$add_mobile}\"> " . _hint(_('Max. 16 numeric or 11 alphanumeric characters')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('SMS footer') . "</td><td><input type='text' maxlength='30' name='add_footer' value=\"{$add_footer}\"> " . _hint(_('Max. 30 alphanumeric characters')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Timezone') . "</td><td><input type='text' size='5' maxlength='5' name='add_datetime_timezone' value=\"{$add_datetime_timezone}\"> " . _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Active language') . "</td><td><select name='add_language_module'>{$option_language_module}</select></td>\n\t\t</tr>\n\t\t</tbody>\n\t\t</table>\n\t\t<p><input type='submit' class='button' value='" . _('Save') . "'></p>\n\t\t</form>\n\t\t" . _back('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=' . $view);
     _p($content);
     break;
 case "user_add_yes":
     $add['email'] = $_POST['add_email'];
     $add['status'] = $_POST['add_status'];
     $add['acl_id'] = (int) $_POST['add_acl_id'];
     $add['username'] = $_POST['add_username'];
     $add['password'] = $_POST['add_password'];
     $add['mobile'] = $_POST['add_mobile'];
     $add['name'] = $_POST['add_name'];
     $add['footer'] = $_POST['add_footer'];
     $add['datetime_timezone'] = $_POST['add_datetime_timezone'];
     $add['language_module'] = $_POST['add_language_module'];
     // subuser's parent uid, by default its uid=1
예제 #2
0
     // fixme anton - now disabled since plugin/feature/credit exists
     // $option_credit = "<tr><td>" . _('Credit') . "</td><td><input type=text maxlength=14 name=up_credit value=\"$credit\"></td></tr>";
     if ($is_parent) {
         $button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete subuser ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=core_user&route=subuser_mgmnt&op=subuser_del" . $url_uname . "')\">";
         $button_back = _back('index.php?app=main&inc=core_user&route=subuser_mgmnt&op=subuser_list');
     } else {
         $button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete user ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=core_user&route=user_mgmnt&op=user_del" . $url_uname . "&view=" . $view . "')\">";
         $button_back = _back('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=' . $view);
     }
 } else {
     $form_title = _('User configuration');
     // fixme anton - now disabled since plugin/feature/credit exists
     // $option_credit = "<tr><td>" . _('Credit') . "</td><td>$credit</td></tr>";
 }
 // get access control list
 $c_option_acl = array_flip(acl_getall());
 $option_acl = _input('text', '', acl_getname($acl_id), array('readonly'));
 if (auth_isadmin()) {
     $option_acl = _select('up_acl_id', $c_option_acl, $acl_id);
 }
 if ($user_edited['status'] == 4) {
     $parent_id = user_getparentbyuid($user_edited['uid']);
     if ($parent_id == $user_config['uid']) {
         $c_option_acl = array_flip(acl_getallbyuid($user_config['uid']));
         $option_acl = _select('up_acl_id', $c_option_acl, $acl_id);
     }
 }
 // additional user's config available on registry
 $data = registry_search($c_uid, 'core', 'user_config');
 // credit unicodes messages as single message
 $option_enable_credit_unicode = _options(array(_('yes') => 1, _('no') => 0), $data['core']['user_config']['enable_credit_unicode']);
예제 #3
0
 // enable forgot yes-no option
 $option_enable_forgot = _options(array(_('yes') => 1, _('no') => 0), $main_config['enable_forgot']);
 // disable login as subuser yes-no option
 $option_disable_login_as = _options(array(_('yes') => 1, _('no') => 0), $main_config['disable_login_as']);
 // enhance privacy for subusers
 $option_enhance_privacy_subuser = _options(array(_('yes') => 1, _('no') => 0), $main_config['enhance_privacy_subuser']);
 // enable logo yes-no option
 $option_enable_logo = _options(array(_('yes') => 1, _('no') => 0), $main_config['enable_logo']);
 // enable logo to replace main website title yes-no option
 $option_logo_replace_title = _options(array(_('yes') => 1, _('no') => 0), $main_config['logo_replace_title']);
 // option default account status on user registration
 $option_default_user_status = _options(array(_('User') => 3, _('Subuser') => 4), $main_config['default_user_status']);
 // option default parent upon registration
 $option_default_parent = themes_select_account_level_single(3, 'edit_default_parent', $main_config['default_parent']);
 // get access control list
 $c_option_default_acl = array_flip(acl_getall());
 $option_default_acl = _select('edit_default_acl', $c_option_default_acl, $main_config['default_acl']);
 // get gateway options
 $main_gateway = $main_config['gateway_module'];
 unset($smsc_list);
 $list = gateway_getall_smsc();
 foreach ($list as $smsc) {
     $smsc_list[] = $smsc['name'];
 }
 $option_gateway_module = _options($smsc_list, $main_gateway);
 // get themes options
 $main_themes = $main_config['themes_module'];
 $option_themes_module = _options($core_config['themeslist'], $main_themes);
 // get language options
 $lang_list = '';
 for ($i = 0; $i < count($core_config['languagelist']); $i++) {