Пример #1
0
<?php

/**
 * Created by PhpStorm.
 * User: administrator
 * Date: 2015/9/1
 * Time: 21:08
 */
require_once '../include.php';
echo more(15);
Пример #2
0
function show_help()
{
    $show_help_text = <<<EOF

\tEnter a series of commands and then execute the set with "exec".
\t
\tFor example:
\techo "foo"; // php command
\techo "foo2"; // php command
\t! echo "heh" # shell command
\texec

\tExample commands:

\tstartrecording <recordingfilename>
\tstoprecording <recordingfilename>
\tshowrecordings

\tparse_config(true);  # reloads the \$config array

\t\$temp = print_r(\$config, true);
\tmore(\$temp);

\t/* to output a configuration array */
\tprint_r(\$config);
\t
\t/* to output the interfaces configuration portion of config.xml */
\tprint_r(\$config['interfaces']);
\t
\t/* to output the dhcp server configuration */
\tprint_r(\$config['dhcpd']);

\t/* to exit the php {$g['product_name']} shell */
\texit
\t
\t/* to output supported wireless modes for an interface */
\tprint_r(get_wireless_modes(\\"ath0\\"));
\t
\t/* to enable SSH */
\t\$config['system']['enablesshd'] = true;
\t
\t/* change OPTX to the OPT interface name such as BACKHAUL */
\t\$config['interfaces']['optx']['wireless']['standard'] = "11a";
\t\$config['interfaces']['optx']['wireless']['mode'] = "hostap";
\t\$config['interfaces']['optx']['wireless']['channel'] = "6";
\t
\t/* to enable dhcp server for an optx interface */
\t\$config['dhcpd']['optx']['enable'] = true;
\t\$config['dhcpd']['optx']['range']['from'] = "192.168.31.100";
\t\$config['dhcpd']['optx']['range']['to'] = "192.168.31.150";
\t
\t/* to disable the firewall filter */
\t\$config['system']['disablefilter'] = true;
\t
\t/* to enable an interface and set it for dhcp */
\t\$config['interfaces']['optx']['disabled'] = false;
\t\$config['interfaces']['optx']['ipaddr'] = "dhcp";
\t
\t/* to enable an interface and set a static ip address */
\t\$config['interfaces']['wan']['disabled'] = false;
\t\$config['interfaces']['wan']['ipaddr'] = "192.168.100.1";
\t\$config['interfaces']['wan']['subnet'] = "24";
\t
\t/* to save out the new configuration (config.xml) */
\twrite_config();
\t
\t/* to reboot the system after saving */
\tsystem_reboot_sync();
\t
EOF;
    more($show_help_text);
}
Пример #3
0
$users_phone = removePlus($phone);
if (@$_REQUEST['msgdata']) {
    $user_msg = trim(urldecode($_REQUEST['msgdata']));
    //echo $user_msg;
    $tokens = explode(" ", $user_msg);
    if (strtoupper(trim($tokens[0])) == 'STOP') {
        //echo trim($tokens[0]); exit;
        $service = '';
        for ($i = 1; $i <= count($tokens); $i++) {
            @($service .= $tokens[$i] . " ");
        }
        deactivate($phone, trim($service));
    } elseif (strtoupper(trim($tokens[0])) == 'HELP') {
        help($phone);
    } elseif (strtoupper(trim($tokens[0])) == 'MORE') {
        more($phone);
    }
}
$data = R::find('users', ' mobile_number = :phone', array('phone' => $users_phone));
@($category = R::find('category', 1));
#check if its a new user
if ($data) {
    $cat_id = findCategory($user_msg);
    $msg = $_SESSION['not'];
    #not a new user
    if ($cat_id) {
        $sub_data = R::findOne('subscription', ' user_phone = :phone and category_id = :cat', array('phone' => $phone, 'cat' => $cat_id));
        if ($sub_data) {
            #User subscribed for a category
            if ($cat_id) {
                #If the category is listed