Example #1
0
<?php

$html = '';
$html .= heading(_('Tokens'), 2);
$html .= '<div id="line"><div class="spacer"></div><div class="spacer"></div></div>';
if (!$tokens) {
    $html .= _('No tokens associated with this user');
} else {
    $html .= form_open($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    $html .= form_hidden('f', 'action');
    $html .= form_hidden('m', 'restapi');
    $html .= form_hidden('action', 'save');
    $table = new CI_Table();
    foreach ($tokens as $token) {
        $t = restapi_tokens_get($token);
        $name = $t['name'] ? $t['name'] : _('Token') . ' ' . $token;
        $label = fpbx_label($name, $t['desc']);
        $status_opts = array('enabled' => _('Enabled'), 'disabled' => _('Disabled'));
        $status = form_dropdown('token_status[' . $token . ']', $status_opts, $t['token_status']);
        $table->add_row(array('data' => heading($label, 5) . '<hr>', 'colspan' => 2));
        $table->add_row(_('Token'), $t['token']);
        $table->add_row(_('Token Key'), $t['tokenkey']);
        $table->add_row(_('Status'), $status);
    }
    $table->add_row(form_submit('save', _('Save')));
    $html .= $table->generate();
    $html .= form_close() . br();
}
echo $html;
Example #2
0
//deny
$label = fpbx_label(_('Deny'), _('Gloabl IP address blacklist'));
$data = array('name' => 'deny', 'value' => implode("\n", $deny) . "\n", 'placeholder' => 'NOT YET IMPLEMENTED', 'cols' => 20, 'rows' => count($deny) + 2);
$table->add_row($label, form_textarea($data));
//allow
$label = fpbx_label(_('Allow'), _('Gloabl IP address whitelist'));
$data = array('name' => 'allow', 'value' => implode("\n", $allow) . "\n", 'placeholder' => 'NOT YET IMPLEMENTED', 'cols' => 20, 'rows' => count($allow) + 2);
$table->add_row($label, form_textarea($data));
//Authorization
$table->add_row(array('data' => heading(_('Authorization'), 5) . '<hr>', 'colspan' => 2));
//users
$label = fpbx_label(_('Users'), _('Users whos data this token may read and write'));
$table->add_row($label, form_multiselect('users[]', $core_user_list_all, $users));
//modules
$label = fpbx_label(_('Modules'), _('Modules this token may read and write'));
$table->add_row($label, form_multiselect('modules[]', $module_list, $modules));
//Accounting
$table->add_row(array('data' => heading(_('Accounting'), 5) . '<hr>', 'colspan' => 2));
//rate limits
$label = fpbx_label(_('Rate Limit'), _('Quantity of API requests this token can make per hour'));
$data = array('name' => 'rate', 'value' => $rate, 'type' => 'number', 'max' => 1000);
$table->add_row($label, form_input($data) . ' ' . _('requests per hour'));
$html .= $table->generate();
$html .= br(3);
$html .= form_submit('submit', _('Submit'));
if (isset($id)) {
    $html .= form_submit('submit', _('Delete'));
}
$html .= form_close();
//$html .= '<script type="text/javascript" src="modules/parking/assets/js/views/park.js"></script>';
echo $html;
Example #3
0
$data = array('name' => 'username', 'value' => $username, 'required' => '', 'placeholder' => _('username'));
$table->add_row($label, form_input($data));
//password
$label = fpbx_label(_('Password'), _('Admin password'));
$data = array('name' => 'password', 'type' => 'password', 'value' => $password, 'required' => '', 'placeholder' => _('password'));
$table->add_row($label, form_input($data));
//confirm password
$label = fpbx_label(_('Confirm Password'));
$data = array('name' => 'confirm_password', 'value' => $confirm_password, 'type' => 'password', 'required' => '', 'placeholder' => _('password'));
$table->add_row($label, form_input($data));
//email address
$label = fpbx_label(_('Admin Email address'));
$data = array('name' => 'email_address', 'value' => $email_address, 'type' => 'email', 'placeholder' => _('email address'));
$table->add_row($label, form_input($data));
//Confirm email address
$label = fpbx_label(_('Confirm Email address'));
$data = array('name' => 'confirm_email', 'value' => $confirm_email, 'type' => 'email', 'placeholder' => _('confirm email'));
$table->add_row($label, form_input($data));
$html .= $table->generate();
$html .= br(5);
$html .= form_hidden('action', 'setup_admin');
$html .= form_submit('submit', _('Set up my Account'));
$html .= form_close();
/*$html .= '<script type="text/javascript">';
$html .= '$(document).ready(function(){
		$("#key").click(function(){
			dest = "ssh://" + window.location.hostname + " \"/usr/sbin/amportal a u ' . session_id() . '\"";
			console.log(dest)
			window.open(dest).close(); setTimeout(\'window.location.reload()\', 3000);
		});
})';
Example #4
0
function displayRepoSelect($buttons)
{
    global $display, $type, $online, $tabindex;
    global $active_repos;
    $standard_repo = true;
    $extended_repo = true;
    $unsupported_repo = false;
    $commercial_repo = true;
    $button_display = '';
    $href = "config.php?display={$display}&type={$type}";
    $button_template = '<input type="button" value="%s" onclick="location.href=\'%s\';" />' . "\n";
    foreach ($buttons as $button) {
        switch ($button) {
            case 'local':
                $button_display .= sprintf($button_template, _("Manage local modules"), $href);
                break;
            case 'upload':
                $button_display .= sprintf($button_template, _("Upload modules"), $href . '&extdisplay=upload');
                break;
        }
    }
    $tooltip = _("Choose the repositories that you want to check for new modules. Any updates available for modules you have on your system will be detected even if the repository is not checked. If you are installing a new system, you may want to start with the Basic repository and update all modules, then go back and review the others.") . ' ';
    $tooltip .= _(" The modules in the Extended repository are less common and may receive lower levels of support. The Unsupported repository has modules that are not supported by the FreePBX team but may receive some level of support by the authors.") . ' ';
    $tooltip .= _("The Commercial repository is reserved for modules that are available for purchase and commercially supported.") . ' ';
    $tooltip .= '<br /><br /><small><i>(' . _("Checking for updates will transmit your FreePBX, Distro, Asterisk and PHP version numbers along with a unique but random identifier. This is used to provide proper update information and track version usage to focus development and maintenance efforts. No private information is transmitted.") . ')</i></small>';
    ?>
  <form name="onlineRepo" action="config.php" method="post">
    <input type="hidden" name="display" value="<?php 
    echo $display;
    ?>
"/>
    <input type="hidden" name="type" value="<?php 
    echo $type;
    ?>
"/>
    <input type="hidden" name="online" value="<?php 
    echo $online;
    ?>
"/>
    <table width="600px">
      <tr>
        <td>
          <?php 
    echo fpbx_label(_("Repositories"), $tooltip);
    ?>
        </td><td>
          <table>
            <tr class="repo_boxes">
              <td>
                <input id="standard_repo" type="checkbox" name="active_repos[standard]" value="1" tabindex="<?php 
    echo ++$tabindex;
    ?>
"<?php 
    echo isset($active_repos['standard']) ? "checked" : "";
    ?>
/>
                <label for="standard_repo"><?php 
    echo _("Basic");
    ?>
</label>
              </td>
              <td>
                <input id="extended_repo" type="checkbox" name="active_repos[extended]" value="1" tabindex="<?php 
    echo ++$tabindex;
    ?>
"<?php 
    echo isset($active_repos['extended']) ? "checked" : "";
    ?>
/>
                <label for="extended_repo"><?php 
    echo _("Extended");
    ?>
</label>
              </td>
              <td>
                <input id="unsupported_repo" type="checkbox" name="active_repos[unsupported]" value="1" tabindex="<?php 
    echo ++$tabindex;
    ?>
"<?php 
    echo isset($active_repos['unsupported']) ? "checked" : "";
    ?>
/>
                <label for="unsupported_repo"><?php 
    echo _("Unsupported");
    ?>
</label>
              </td>
              <td>
                <input id="commercial_repo" type="checkbox" name="active_repos[commercial]" value="1" tabindex="<?php 
    echo ++$tabindex;
    ?>
"<?php 
    echo isset($active_repos['commercial']) ? "checked" : "";
    ?>
/>
                <label for="commercial_repo"><?php 
    echo _("Commercial");
    ?>
</label>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <input type="submit" value="<?php 
    echo _("Check Online");
    ?>
" name="check_online" />
    <?php 
    echo $button_display;
    ?>
  </form>
<?php 
}
Example #5
0
 function generatehtml($section = '')
 {
     // this effectivly creates the template using the prompttext and html_input
     // we would expect the $html_input to be set by the child class
     $output = '';
     // start new row
     if ($section) {
         $mysec = preg_replace('/[^A-Za-z]/', '', $section);
         $output .= '<tr class="' . $section . '" ' . (isset($this->_opts[$mysec]['guielToggle']) && $this->_opts[$mysec]['guielToggle'] == false ? ' style="display:none" ' : '') . ' >' . "\n";
     } else {
         $output .= "\t<tr>\n";
     }
     // prompt in first column
     $output .= "\t\t<td>";
     if ($this->helptext != '') {
         $output .= fpbx_label($this->prompttext, $this->helptext);
     } else {
         $output .= $this->prompttext;
     }
     $output .= "</td>\n";
     // actual input in second row
     $output .= "\t\t<td>";
     $output .= $this->html_input;
     $output .= "</td>\n";
     // end this row
     $output .= "\t</tr>\n";
     return $output;
 }
Example #6
0
<form name="onlineRepo" action="config.php" method="post">
	<input type="hidden" name="display" value="modules"/>
	<input type="hidden" name="online" value="<?php 
echo $online;
?>
"/>
	<?php 
if (!empty($repo_list)) {
    ?>
		<table width="600px">
			<tr>
				<td>
					<?php 
    echo fpbx_label(_("Repositories"), $tooltip);
    ?>
				</td>
				<td>
					<table>
						<tr class="repo_boxes radioset">
							<?php 
    foreach ($repo_list as $repo) {
        ?>
								<td>
									<input id="<?php 
        echo $repo;
        ?>
_repo" type="checkbox" name="active_repos[<?php 
        echo $repo;
        ?>
]" value="1" tabindex="<?php 
        echo ++$tabindex;
function ivr_draw_entries_table_header_ivr()
{
    return array(fpbx_label(_('Digits'), _("Digits the caller needs to dial to access said destination")), fpbx_label(_('Destination'), _("Choose a destination to route the call to")), fpbx_label(_('Return'), _('Return to this IVR when finished')), _('Delete'));
}
Example #8
0
$queuelogno = form_radio($queuelogno) . form_label(_('No'), 'queuelogno');
$label = fpbx_label(_('Log Queues'), _('Log queue events to a file'));
$table->add_row($label, '<span class="radioset">' . $queuelogyes . $queuelogno . '</radioset>');
$html .= $table->generate();
$html .= br(2);
//log files
$html .= heading(_('Log Files'), 5) . '<hr style="width:50%: margin-left: 0; margin-right: 50%">';
$table = new CI_Table();
$table->set_template(array('table_open' => '<table class="alt_table" id="logfile_entries">'));
//draw table header with help on every option
$has_security_option = version_compare($amp_conf['ASTVERSION'], '11.0', 'ge');
$heading = array(fpbx_label(_('File Name'), _('Name of file, relative to TODO!!!!. Use absolute path for a different location')), fpbx_label(_('Debug'), 'debug: ' . _('Messages used for debuging. ' . 'Do not report these as error\'s unless you have a ' . 'specific issue that you are attempting to debug. ' . 'Also note that Debug messages are also very verbose ' . 'and can and do fill up logfiles (and disk storage) quickly.')), fpbx_label(_('DTMF'), 'dtmf: ' . _('Keypresses as understood by asterisk. Usefull for debuging IVR and VM issues.')), fpbx_label(_('Error'), 'error: ' . _('Critical errors and issues')), fpbx_label(_('Fax'), 'fax: ' . _('Transmition and receiving of faxes')), fpbx_label(_('Notice'), 'notice: ' . _('Messages of specific actions, such as a phone registration or call completion')), fpbx_label(_('Verbose'), 'verbose: ' . _('Step-by-step messages of every step of a call flow. ' . 'Always enable and review if calls dont flow as expected')), fpbx_label(_('Warning'), 'warning: ' . _('Possible issues with dialplan syntaxt or call flow, but not critical.')));
if ($has_security_option) {
    $heading[] = fpbx_label(_('Security'), 'security: ' . _('Notification of security related events such as authentication attempts.'));
}
$heading[] = fpbx_label(_('Delete'));
$table->set_heading($heading);
//actual log files
$count = 0;
//$logfiles[] = array('name' => 'test', 'debug' => 'off', 'dtmf' => 'off', 'error' => 'on', 'fax' => 'off', 'notice' => 'on', 'verbose' => 'on', 'warning' => 'on');
foreach ($logfiles as $l) {
    $row[] = form_input(array('name' => 'logfiles[name][]', 'value' => $l['name'], 'placeholder' => _('file path/name'), 'required' => ''));
    $onoff = array('on' => _('On'), 'off' => _('Off'));
    $row[] = form_dropdown('logfiles[debug][]', $onoff, $l['debug']);
    $row[] = form_dropdown('logfiles[dtmf][]', $onoff, $l['dtmf']);
    $row[] = form_dropdown('logfiles[error][]', $onoff, $l['error']);
    $row[] = form_dropdown('logfiles[fax][]', $onoff, $l['fax']);
    $row[] = form_dropdown('logfiles[notice][]', $onoff, $l['notice']);
    $row[] = form_dropdown('logfiles[verbose][]', $onoff, $l['verbose']);
    $row[] = form_dropdown('logfiles[warning][]', $onoff, $l['warning']);
    if ($has_security_option) {
Example #9
0
$html .= form_open($_SERVER['REQUEST_URI'], array('id' => 'files_browes_frm'));
$html .= form_hidden('action', 'restore');
//files
$html .= '<h3>Select items to restore<hr /></h3>';
$html .= '<div id="restore_items">';
$html .= '<script type="text/javascript">var FILE_LIST=';
$html .= json_encode(backup_jstree_json_backup_files($manifest['file_list']));
$html .= '</script>';
$html .= '<div id="backup_files_container"><div id="backup_files">';
$html .= _("Please wait, loading...");
$html .= '</div></div>';
//databases
if ($manifest['fpbx_db'] || $manifest['astdb']) {
    $html .= br();
    $html .= fpbx_label(_('PBX Settings'), _('Restore all setting stored in the database'));
    $html .= ' ' . form_checkbox('restore[settings]', 'true');
}
//cdr's
if ($manifest['fpbx_cdrdb']) {
    $html .= br();
    $html .= fpbx_label(_('CDR\'s'), _('Restore CDR records stored in this backup'));
    $html .= ' ' . form_checkbox('restore[cdr]', 'true');
}
$html .= '</div>';
$html .= br();
$html .= form_submit(array('name' => 'submit', 'value' => _('Restore'), 'id' => 'run_restore'));
$html .= form_close();
$html .= br(15);
$html .= '<script type="text/javascript" src="modules/backup/assets/js/views/restore.js"></script>';
$html .= '<script type="text/javascript" src="modules/backup/assets/js/views/jquery.jstree.min.js"></script>';
echo $html;
Example #10
0
	<td>
	  <input type="text" name="externip" id="externip" class="localnet validate=ip" value="<?php 
echo $externip;
?>
"> &nbsp;
	  <button id='autodetect'><?php 
echo _('Detect External IP');
?>
</button>
	</td>
  </tr>

  <tr class='lnet' data-nextid=1>
	<td>
	  <?php 
echo fpbx_label(_("Local Networks"), _("Local network settings in the form of ip/cidr or ip/netmask. For networks with more than 1 LAN subnets, use the Add Local Network Field button for more fields. Blank fields will be ignored."));
?>
	</td>
	<td>
	  <input type="text" name="localnets[0][net]" class="localnet network validate=ip" value="<?php 
echo $localnets[0]['net'];
?>
"> /
	  <input type="text" name="localnets[0][mask]" class="netmask cidr validate-netmask" value="<?php 
echo $localnets[0]['mask'];
?>
">
	</td>
  </tr>

<?php 
Example #11
0
	<tr>
		<td>
			<?php 
echo fpbx_label(_("Disable Standard Prompt after Max Loops"), _("If the Max Loops are reached and the call goes to voicemail, checking this box will disable the standard voicemail prompt prompt that follows the user's recorded greeting. This default can be overriden with a unique ..vmx/vmxopts/loops AstDB entry for the given mode (busy/unavail) and user."));
?>
		</td>
		<td>
			<?php 
echo form_checkbox('VMX_OPTS_LOOP', 's', $settings['VMX_OPTS_LOOP']);
?>
		</td>
	</tr>
	<tr>
		<td>
			<?php 
echo fpbx_label(_("Disable Standard Prompt on 'dovm' Extension"), _("If the special advanced extension of 'dovm' is used, checking this box will disable the standard voicemail prompt prompt that follows the user's recorded greeting. This default can be overriden with a unique ..vmx/vmxopts/dovm AstDB entry for the given mode (busy/unavail) and user."));
?>
		</td>
		<td>
			<?php 
echo form_checkbox('VMX_OPTS_DOVM', 's', $settings['VMX_OPTS_DOVM']);
?>
		</td>
	</tr>
	<tr>
		<td>
			
		</td>
		<td colspan='2'>
			<br />
		</td>
Example #12
0
echo ++$tabindex;
?>
"/>
				</td>
			</tr>

<?php 
$data['name'] = $data['id'] = 'dialopts';
if ($dialopts !== false) {
    $data['value'] = $dialopts;
} else {
    $data['disabled'] = true;
}
$data['size'] = '20';
$data['tabindex'] = $tabindex++;
$dialopts_label = fpbx_label(_('Asterisk Trunk Dial Options'), _('Asterisk Dial command options to be used when calling out this trunk. To override the Advanced Settings default, check the box and then provide the required options for this trunk')) . "\n";
$dialopts_box = fpbx_form_input_check($data, '', '', '<small>' . _('Override') . '</small>', $amp_conf['TRUNK_OPTIONS'], true) . "\n";
?>
			<tr>
				<td>
					<?php 
echo $dialopts_label;
?>
				</td><td>
					<?php 
echo $dialopts_box;
?>
				</td>
			</tr>

			<tr>