/**
  * Handles POST requests from the options admin page
  */
 public function post_options()
 {
     $option_items = array();
     $timezones = DateTimeZone::listIdentifiers();
     $timezones = array_merge(array('' => ''), array_combine(array_values($timezones), array_values($timezones)));
     $option_items[_t('Name & Tagline')] = array('title' => array('label' => _t('Site Name'), 'type' => 'text', 'helptext' => ''), 'tagline' => array('label' => _t('Site Tagline'), 'type' => 'text', 'helptext' => ''), 'about' => array('label' => _t('About'), 'type' => 'textarea', 'helptext' => ''));
     $option_items[_t('Publishing')] = array('pagination' => array('label' => _t('Items per Page'), 'type' => 'text', 'helptext' => ''), 'atom_entries' => array('label' => _t('Entries to show in Atom feed'), 'type' => 'text', 'helptext' => ''), 'comments_require_id' => array('label' => _t('Require Comment Author Info'), 'type' => 'checkbox', 'helptext' => ''), 'spam_percentage' => array('label' => _t('Comment SPAM Threshold'), 'type' => 'text', 'helptext' => _t('The likelihood a comment is considered SPAM, in percent.')));
     $option_items[_t('Time & Date')] = array('timezone' => array('label' => _t('Time Zone'), 'type' => 'select', 'selectarray' => $timezones, 'helptext' => _t('Current Date Time: %s', array(HabariDateTime::date_create()->format()))), 'dateformat' => array('label' => _t('Date Format'), 'type' => 'text', 'helptext' => _t('Current Date: %s', array(HabariDateTime::date_create()->date))), 'timeformat' => array('label' => _t('Time Format'), 'type' => 'text', 'helptext' => _t('Current Time: %s', array(HabariDateTime::date_create()->time))));
     $option_items[_t('Language')] = array('locale' => array('label' => _t('Locale'), 'type' => 'select', 'selectarray' => array_merge(array('' => 'default'), array_combine(HabariLocale::list_all(), HabariLocale::list_all())), 'helptext' => _t('International language code')), 'system_locale' => array('label' => _t('System Locale'), 'type' => 'text', 'helptext' => _t('The appropriate locale code for your server')));
     $option_items[_t('Troubleshooting')] = array('log_min_severity' => array('label' => _t('Minimum Severity'), 'type' => 'select', 'selectarray' => LogEntry::list_severities(), 'helptext' => _t('Only log entries with a this or higher severity.')), 'log_backtraces' => array('label' => _t('Log Backtraces'), 'type' => 'checkbox', 'helptext' => _t('Logs error backtraces to the log table\'s data column. Can drastically increase log size!')));
     /*$option_items[_t('Presentation')] = array(
     		'encoding' => array(
     			'label' => _t('Encoding'),
     			'type' => 'select',
     			'selectarray' => array(
     				'UTF-8' => 'UTF-8'
     				),
     			'helptext' => '',
     			),
     		);*/
     $option_items = Plugins::filter('admin_option_items', $option_items);
     $form = new FormUI('Admin Options');
     $tab_index = 3;
     foreach ($option_items as $name => $option_fields) {
         $fieldset = $form->append('wrapper', Utils::slugify(_u($name)), $name);
         $fieldset->class = 'container settings';
         $fieldset->append('static', $name, '<h2>' . htmlentities($name, ENT_COMPAT, 'UTF-8') . '</h2>');
         foreach ($option_fields as $option_name => $option) {
             $field = $fieldset->append($option['type'], $option_name, $option_name, $option['label']);
             $field->template = 'optionscontrol_' . $option['type'];
             $field->class = 'item clear';
             if ($option['type'] == 'select' && isset($option['selectarray'])) {
                 $field->options = $option['selectarray'];
             }
             $field->tabindex = $tab_index;
             $tab_index++;
             if (isset($option['helptext'])) {
                 $field->helptext = $option['helptext'];
             } else {
                 $field->helptext = '';
             }
         }
     }
     /* @todo: filter for additional options from plugins
      * We could either use existing config forms and simply extract
      * the form controls, or we could create something different
      */
     $submit = $form->append('submit', 'apply', _t('Apply'), 'admincontrol_submit');
     $submit->tabindex = $tab_index;
     $form->on_success(array($this, 'form_options_success'));
     $this->theme->form = $form->get();
     $this->theme->option_names = array_keys($option_items);
     $this->theme->display('options');
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     // Let's register the options page form so we can use it with ajax
     $self = $this;
     FormUI::register('admin_options', function ($form, $name, $extra_data) use($self) {
         $option_items = array();
         $timezones = \DateTimeZone::listIdentifiers();
         $timezones = array_merge(array('' => ''), array_combine(array_values($timezones), array_values($timezones)));
         $option_items[_t('Name & Tagline')] = array('title' => array('label' => _t('Site Name'), 'type' => 'text', 'helptext' => ''), 'tagline' => array('label' => _t('Site Tagline'), 'type' => 'text', 'helptext' => ''), 'about' => array('label' => _t('About'), 'type' => 'textarea', 'helptext' => ''));
         $option_items[_t('Publishing')] = array('pagination' => array('label' => _t('Items per Page'), 'type' => 'text', 'helptext' => ''), 'atom_entries' => array('label' => _t('Entries to show in Atom feed'), 'type' => 'text', 'helptext' => ''), 'comments_require_id' => array('label' => _t('Require Comment Author Email'), 'type' => 'checkbox', 'helptext' => ''), 'spam_percentage' => array('label' => _t('Comment SPAM Threshold'), 'type' => 'text', 'helptext' => _t('The likelihood a comment is considered SPAM, in percent.')));
         $option_items[_t('Time & Date')] = array('timezone' => array('label' => _t('Time Zone'), 'type' => 'select', 'selectarray' => $timezones, 'helptext' => _t('Current Date Time: %s', array(DateTime::create()->format()))), 'dateformat' => array('label' => _t('Date Format'), 'type' => 'text', 'helptext' => _t('Current Date: %s', array(DateTime::create()->date))), 'timeformat' => array('label' => _t('Time Format'), 'type' => 'text', 'helptext' => _t('Current Time: %s', array(DateTime::create()->time))));
         $option_items[_t('Language')] = array('locale' => array('label' => _t('Locale'), 'type' => 'select', 'selectarray' => array_merge(array('' => 'default'), array_combine(Locale::list_all(), Locale::list_all())), 'helptext' => Config::exists('locale') ? _t('International language code : This value is set in your config.php file, and cannot be changed here.') : _t('International language code'), 'disabled' => Config::exists('locale'), 'value' => Config::get('locale', Options::get('locale', 'en-us'))), 'system_locale' => array('label' => _t('System Locale'), 'type' => 'text', 'helptext' => _t('The appropriate locale code for your server')));
         $option_items[_t('Troubleshooting')] = array('log_min_severity' => array('label' => _t('Minimum Severity'), 'type' => 'select', 'selectarray' => LogEntry::list_severities(), 'helptext' => _t('Only log entries with a this or higher severity.')), 'log_backtraces' => array('label' => _t('Log Backtraces'), 'type' => 'checkbox', 'helptext' => _t('Logs error backtraces to the log table\'s data column. Can drastically increase log size!')));
         $option_items = Plugins::filter('admin_option_items', $option_items);
         $tab_index = 3;
         foreach ($option_items as $name => $option_fields) {
             /** @var FormControlFieldset $fieldset  */
             $fieldset = $form->append(FormControlWrapper::create(Utils::slugify(_u($name)))->set_properties(array('class' => 'container main settings')));
             $fieldset->append(FormControlStatic::create($name)->set_static('<h2 class="lead">' . htmlentities($name, ENT_COMPAT, 'UTF-8') . '</h2>'));
             $fieldset->set_wrap_each('<div>%s</div>');
             foreach ($option_fields as $option_name => $option) {
                 /** @var FormControlLabel $label */
                 $label = $fieldset->append(FormControlLabel::create('label_for_' . $option_name, null)->set_label($option['label']));
                 /** @var FormControl $field */
                 $field = $label->append($option['type'], $option_name, $option_name);
                 $label->set_for($field);
                 if (isset($option['value'])) {
                     $field->set_value($option['value']);
                 }
                 if (isset($option['disabled']) && $option['disabled'] == true) {
                     $field->set_properties(array('disabled' => 'disabled'));
                 }
                 if ($option['type'] == 'select' && isset($option['selectarray'])) {
                     $field->set_options($option['selectarray']);
                 }
                 $field->tabindex = $tab_index;
                 $tab_index++;
                 if (isset($option['helptext'])) {
                     $field->set_helptext($option['helptext']);
                 }
             }
         }
         $buttons = $form->append(new FormControlWrapper('buttons', null, array('class' => 'container')));
         $buttons->append(FormControlSubmit::create('apply', null, array('tabindex' => $tab_index))->set_caption(_t('Apply')));
         $form->on_success(array($self, 'form_options_success'));
         $form = Plugins::filter('admin_options_form', $form);
     });
 }
Example #3
0
<?php

defined('_SECURE_') or die('Forbidden');
if (!auth_isadmin()) {
    auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/template/config.php";
switch (_OP_) {
    case "manage":
        if ($err = TRUE) {
            $content = _dialog();
        }
        $content .= "\n\t    <h2>" . _('Manage template') . "</h2>\n\t    <p>\n\t    <form action=index.php?app=main&inc=gateway_template&op=manage_save method=post>\n\t    " . _CSRF_FORM_ . "\n\t    <table class=playsms-table cellpadding=1 cellspacing=2 border=0>\n\t\t<tr>\n\t\t    <td class=label-sizer>" . _('Gateway name') . "</td><td>template</td>\n\t\t</tr>\n\t\t<tr>\n\t\t    <td>" . _('Template installation path') . "</td><td><input type=text maxlength=250 name=up_path value=\"" . $template_param['path'] . "\"> (" . _('No trailing slash') . " \"/\")</td>\n\t\t</tr>\n\t    </table>\n\t    <p><input type=submit class=button value=\"" . _('Save') . "\">\n\t    </form>";
        _p($content);
        break;
    case "manage_save":
        $up_path = $_POST['up_path'];
        $_SESSION['dialog']['info'][] = _('No changes have been made');
        if ($up_path) {
            $db_query = "\n\t\tUPDATE " . _DB_PREF_ . "_gatewayTemplate_config\n\t\tSET c_timestamp='" . mktime() . "',cfg_path='{$up_path}'\n\t    ";
            if (@dba_affected_rows($db_query)) {
                $_SESSION['dialog']['info'][] = _('Gateway module configurations has been saved');
            }
        }
        header("Location: " . _u('index.php?app=main&inc=gateway_template&op=manage'));
        exit;
        break;
}
Example #4
0
 */
$app->get(_u('/users/{id}'), 'res.User:get');
$app->get(_u('/users'), 'res.Users:get');
$app->post(_u('/users'), 'res.Users:post');
$app->get(_u('/courses'), 'res.Courses:get');
$app->get(_u('/lessons'), 'res.Lessons:get');
$app->get(_u('/threads'), 'res.Threads:get');
$app->get(_u('/chaos_threads'), 'res.ChaosThreads:get');
$app->get(_u('/articles'), 'res.Articles:get');
$app->get(_u('/articles/{id}'), 'res.Article:get');
$app->get(_u('/article_categories'), 'res.ArticleCategories:get');
$app->get(_u('/courses/{courseId}/members'), 'res.CourseMembers:get');
$app->get(_u('/classrooms'), 'res.Classrooms:get');
$app->post(_u('/classrooms'), 'res.Classrooms:post');
$app->get(_u('/classrooms/{id}'), 'res.Classroom:get');
$app->post(_u('/classrooms/{id}'), 'res.Classroom:post');
$app->get(_u('/classrooms/{classroomId}/members'), 'res.ClassroomMembers:get');
$app->get(_u('/classrooms/{classroomId}/members/{memberId}'), 'res.ClassroomMember:get');
$app->get(_u('/exercise/{id}'), 'res.Exercise:get');
$app->get(_u('/exercise/{id}/result'), 'res.Exercise:result');
$app->post(_u('/exercise_results/{exerciseId}'), 'res.ExerciseResult:post');
$app->get(_u('/exercise_results/{lessonId}'), 'res.ExerciseResult:get');
$app->get(_u('/me/chatrooms'), 'res.MeChatroomes:get');
$app->get(_u('/mobileschools/apps'), 'res.Apps:get');
$app->get(_u('/mobileschools/app/{id}'), 'res.App:get');
$app->get(_u('/homework/{id}'), 'res.Homework:get');
$app->get(_u('/homework/{id}/result'), 'res.Homework:result');
$app->post(_u('/homework_results/{homeworkId}'), 'res.HomeworkResult:post');
$app->get(_u('/homework_results/{lessonId}'), 'res.HomeworkResult:get');
$app->post(_u('/upload/{group}'), 'res.Upload:post');
Example #5
0
                                                                    <span class="glyphicon glyphicon-edit"></span>
                                                                    <?php 
                __('Edit');
                ?>
                                                                </a>
                                                            </li>
                                                        <?php 
            }
            ?>
                                                        <?php 
            if (have_permission('contents/remove_language')) {
                ?>
                                                            <li>

                                                                <a href="<?php 
                _u('admin/contents/remove_language/' . $language->id);
                ?>
" class="remove-box">
                                                                    <span class="glyphicon glyphicon-trash"></span>
                                                                    <?php 
                __('Remove');
                ?>
                                                                </a>
                                                            </li>
                                                        <?php 
            }
            ?>
                                                    </ul>

                                                </div>
                                                <?php 
Example #6
0
        // credit unicodes messages as single message
        $option_enable_credit_unicode = _options(array(_('yes') => 1, _('no') => 0), $data['core']['user_config']['enable_credit_unicode']);
        if (auth_isadmin()) {
            $option_enable_credit_unicode = "<select name='edit_enable_credit_unicode'>" . $option_enable_credit_unicode . "</select>";
        } else {
            $option_enable_credit_unicode = $user_config['opt']['enable_credit_unicode'] ? _('yes') : _('no');
        }
        // error string
        if ($err = TRUE) {
            $error_content = _dialog();
        }
        $tpl = array('name' => 'user_config', 'vars' => array('Application options' => _('Application options'), 'Username' => _('Username'), 'Access Control List' => _('Access Control List'), 'Effective SMS sender ID' => _('Effective SMS sender ID'), 'Default sender ID' => _('Default sender ID'), 'Default message footer' => _('Default message footer'), 'Webservices username' => _('Webservices username'), 'Webservices token' => _('Webservices token'), 'Renew webservices token' => _('Renew webservices token'), 'Enable webservices' => _('Enable webservices'), 'Webservices IP range' => _('Webservices IP range'), 'Active language' => _('Active language'), 'Timezone' => _('Timezone'), 'Credit' => _('Credit'), 'Enable credit unicode SMS as normal SMS' => _('Enable credit unicode SMS as normal SMS'), 'Forward message to inbox' => _('Forward message to inbox'), 'Forward message to email' => _('Forward message to email'), 'Forward message to mobile' => _('Forward message to mobile'), 'Local number length' => _('Local number length'), 'Prefix or country code' => _('Prefix or country code'), 'Always choose to send as unicode' => _('Always choose to send as unicode'), 'Save' => _('Save'), 'DIALOG_DISPLAY' => $error_content, 'FORM_TITLE' => $form_title, 'BUTTON_DELETE' => $button_delete, 'BUTTON_BACK' => $button_back, 'URL_UNAME' => $url_uname, 'VIEW' => $view, 'HINT_MAX_CHARS' => _hint(_('Max. 16 numeric or 11 alphanumeric characters')), 'HINT_MAX_ALPHANUMERIC' => _hint(_('Max. 30 alphanumeric characters')), 'HINT_COMMA_SEPARATED' => _hint(_('Comma separated')), 'HINT_TIMEZONE' => _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')), 'HINT_LOCAL_LENGTH' => _hint(_('Min length to detect missing country code')), 'HINT_REPLACE_ZERO' => _hint(_('Replace prefix 0 or padding local numbers')), 'HINT_MANAGE_CREDIT' => _hint(_('Add or reduce credit from manage credit menu')), 'HINT_ACL' => _hint(_('ACL DEFAULT will not restrict access to menus')), 'option_new_token' => $option_new_token, 'option_enable_webservices' => $option_enable_webservices, 'option_language_module' => $option_language_module, 'option_fwd_to_inbox' => $option_fwd_to_inbox, 'option_fwd_to_email' => $option_fwd_to_email, 'option_fwd_to_mobile' => $option_fwd_to_mobile, 'option_acl' => $option_acl, 'option_sender_id' => $option_sender_id, 'c_username' => $c_username, 'effective_sender_id' => sendsms_get_sender($c_username), 'sender' => $sender, 'footer' => $footer, 'token' => $token, 'webservices_ip' => $webservices_ip, 'datetime_timezone' => $datetime_timezone, 'local_length' => $local_length, 'replace_zero' => $replace_zero, 'credit' => $credit, 'option_enable_credit_unicode' => $option_enable_credit_unicode));
        _p(tpl_apply($tpl));
        break;
    case "user_config_save":
        $fields = array('footer', 'datetime_timezone', 'language_module', 'fwd_to_inbox', 'fwd_to_email', 'fwd_to_mobile', 'local_length', 'replace_zero', 'new_token', 'enable_webservices', 'webservices_ip', 'sender', 'acl_id');
        $up = array();
        foreach ($fields as $field) {
            if (strlen($_POST['up_' . $field])) {
                $up[$field] = trim($_POST['up_' . $field]);
            }
        }
        $ret = user_edit_conf($c_uid, $up);
        $items['enable_credit_unicode'] = (int) $_POST['edit_enable_credit_unicode'];
        registry_update($c_uid, 'core', 'user_config', $items);
        $_SESSION['dialog']['info'][] = $ret['error_string'];
        _log('saving username:'******' error_string:[' . $ret['error_string'] . ']', 2, 'user_config');
        header("Location: " . _u('index.php?app=main&inc=core_user&route=user_config&op=user_config' . $url_uname . '&view=' . $view));
        exit;
        break;
}
Example #7
0
            <a title="r" data-shortcut="r" href="<?php 
_u($f, 'replace');
?>
" class="btn btn-with-icon">
              <?php 
i('cloud-upload', 'left');
?>
              <?php 
_l('files.show.replace');
?>
            </a>
          </li>

          <li>
            <a title="#" data-shortcut="#" href="<?php 
_u($f, 'delete');
?>
" class="btn btn-with-icon">
              <?php 
i('trash-o', 'left');
?>
              <?php 
_l('files.show.delete');
?>
            </a>
          </li>
        </ul>
      </nav>

    </form>
Example #8
0
        $data = inboxgroup_getdatabyid($rid);
        $in_receiver = $data['in_receiver'];
        if ($rid && $in_receiver) {
            if (inboxgroup_dataenable($rid)) {
                $_SESSION['dialog']['info'][] = _('Group inbox has been enabled') . " (" . _('Number') . ": " . $in_receiver . ")";
            } else {
                $_SESSION['dialog']['info'][] = _('Fail to enable group inbox') . " (" . _('Number') . ": " . $in_receiver . ")";
            }
        } else {
            $_SESSION['dialog']['info'][] = _('Receiver number does not exist');
        }
        header("Location: " . _u('index.php?app=main&inc=feature_inboxgroup&op=list&rid=' . $rid));
        exit;
        break;
    case 'disable':
        $rid = $_REQUEST['rid'];
        $data = inboxgroup_getdatabyid($rid);
        $in_receiver = $data['in_receiver'];
        if ($rid && $in_receiver) {
            if (inboxgroup_datadisable($rid)) {
                $_SESSION['dialog']['info'][] = _('Group inbox has been disabled') . " (" . _('Number') . ": " . $in_receiver . ")";
            } else {
                $_SESSION['dialog']['info'][] = _('Fail to disable group inbox') . " (" . _('Number') . ": " . $in_receiver . ")";
            }
        } else {
            $_SESSION['dialog']['info'][] = _('Receiver number does not exist');
        }
        header("Location: " . _u('index.php?app=main&inc=feature_inboxgroup&op=list&rid=' . $rid));
        exit;
        break;
}
Example #9
0
        $add_service_name = trim($_POST['add_service_name']);
        $add_sms_receiver = trim($_POST['add_sms_receiver']);
        $add_custom_return_as_reply = $_POST['add_custom_return_as_reply'] == 'on' ? '1' : '0';
        $add_custom_url = $_POST['add_custom_url'];
        $add_custom_keyword = strtoupper($_POST['add_custom_keyword']);
        $c_keywords = explode(' ', $add_custom_keyword);
        foreach ($c_keywords as $keyword) {
            if ($keyword) {
                if (keyword_isavail($keyword, $add_sms_receiver)) {
                    $keywords .= core_sanitize_alphanumeric($keyword) . ' ';
                } else {
                    $_SESSION['dialog']['danger'][] = sprintf(_('Keyword %s is not available'), $keyword);
                }
            }
        }
        $keywords = trim($keywords);
        if ($add_service_name && $keywords && $add_custom_url) {
            $db_query = "INSERT INTO " . _DB_PREF_ . "_featureCustom (uid,service_name,custom_keyword,sms_receiver,custom_url,custom_return_as_reply) VALUES ('" . $user_config['uid'] . "','{$add_service_name}','{$keywords}','{$add_sms_receiver}','{$add_custom_url}','{$add_custom_return_as_reply}')";
            if ($new_uid = @dba_insert_id($db_query)) {
                $_SESSION['dialog']['info'][] = sprintf(_('SMS custom with keyword %s has been added'), $keywords);
                _lastpost_empty();
            } else {
                $_SESSION['dialog']['danger'][] = _('Fail to add SMS custom');
            }
        } else {
            $_SESSION['dialog']['danger'][] = _('All mandatory fields must be filled');
        }
        header("Location: " . _u('index.php?app=main&inc=feature_sms_custom&op=sms_custom_add'));
        exit;
        break;
}
Example #10
0
/**
 * This file is part of playSMS.
 *
 * playSMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * playSMS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with playSMS.  If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');
if (_OP_ == 'block') {
    if (auth_isvalid()) {
        $_SESSION['dialog']['danger'][] = _('You have no access to this page');
        logger_print("WARNING: no access or blocked. sid:" . $_SESSION['sid'] . " ip:" . $_SERVER['REMOTE_ADDR'] . " uid:" . $user_config['uid'] . " app:" . _APP_ . " inc:" . _INC_ . " op:" . _OP_ . " route:" . _ROUTE_, 2, "auth_block");
        header("Location: " . _u('index.php?app=main&inc=core_auth&route=block'));
    } else {
        header("Location: " . _u('index.php?app=main&inc=core_auth&route=login'));
    }
    exit;
} else {
    unset($tpl);
    $tpl = array('name' => 'auth_block', 'vars' => array('DIALOG_DISPLAY' => _dialog(), 'HTTP_PATH_BASE' => $core_config['http_path']['base'], 'Home' => _('Home')));
    _p(tpl_apply($tpl));
}
Example #11
0
        }
        break;
    case "import_yes":
        @set_time_limit(0);
        $num = $_POST['number_of_row'];
        $session_import = $_POST['session_import'];
        $data = $_SESSION['tmp'][$session_import];
        foreach ($data as $d) {
            $name = trim($d[0]);
            $destination = trim($d[1]);
            $schedule = trim($d[2]);
            if ($name && $destination && $schedule) {
                $schedule = core_adjust_datetime($schedule);
                // add destiantions, replace existing entry with the same name
                if (dba_isexists(_DB_PREF_ . '_featureSchedule_dst', array('schedule_id' => $schedule_id, 'name' => $name), 'AND')) {
                    // update
                    $items = array('c_timestamp' => mktime(), 'schedule' => $schedule, 'scheduled' => '0000-00-00 00:00:00');
                    $conditions = array('schedule_id' => $schedule_id, 'name' => $name, 'destination' => $destination);
                    dba_update(_DB_PREF_ . '_featureSchedule_dst', $items, $conditions);
                } else {
                    // insert
                    $items = array('schedule_id' => $schedule_id, 'schedule' => $schedule, 'scheduled' => '0000-00-00 00:00:00', 'name' => $name, 'destination' => $destination);
                    dba_add(_DB_PREF_ . '_featureSchedule_dst', $items);
                }
            }
        }
        $_SESSION['dialog']['info'][] = _('Entries in CSV file have been imported');
        header("Location: " . _u('index.php?app=main&inc=feature_schedule&route=import&op=list&schedule_id=' . $schedule_id));
        exit;
        break;
}
Example #12
0
                    $_SESSION['dialog']['danger'][] = _('Fail to recover password');
                }
            } else {
                $_SESSION['dialog']['danger'][] = _('Recover password disabled');
            }
        } else {
            $_SESSION['dialog']['danger'][] = _('Please type the displayed captcha phrase correctly');
        }
    }
    if ($ok) {
        header("Location: " . _u($core_config['http_path']['base']));
    } else {
        header("Location: " . _u('index.php?app=main&inc=core_auth&route=forgot'));
    }
    exit;
} else {
    $enable_logo = FALSE;
    $show_web_title = TRUE;
    if ($core_config['main']['enable_logo'] && $core_config['main']['logo_url']) {
        $enable_logo = TRUE;
        if ($core_config['main']['logo_replace_title']) {
            $show_web_title = FALSE;
        }
    }
    // captcha
    $captcha = new CaptchaBuilder();
    $captcha->build();
    $_SESSION['tmp']['captcha'] = $captcha->getPhrase();
    $tpl = array('name' => 'auth_forgot', 'vars' => array('HTTP_PATH_BASE' => $core_config['http_path']['base'], 'WEB_TITLE' => $core_config['main']['web_title'], 'DIALOG_DISPLAY' => _dialog(), 'URL_ACTION' => _u('index.php?app=main&inc=core_auth&route=forgot&op=forgot'), 'URL_REGISTER' => _u('index.php?app=main&inc=core_auth&route=register'), 'URL_LOGIN' => _u('index.php?app=main&inc=core_auth&route=login'), 'CAPTCHA_IMAGE' => $captcha->inline(), 'HINT_CAPTCHA' => _hint(_('Read and type the captcha phrase on verify captcha field. If you cannot read them please contact administrator.')), 'Username' => _('Username'), 'Email' => _('Email'), 'Recover password' => _('Recover password'), 'Login' => _('Login'), 'Submit' => _('Submit'), 'Register an account' => _('Register an account'), 'Verify captcha' => _('Verify captcha'), 'logo_url' => $core_config['main']['logo_url']), 'ifs' => array('enable_register' => $core_config['main']['enable_register'], 'enable_logo' => $enable_logo, 'show_web_title' => $show_web_title));
    _p(tpl_apply($tpl));
}
Example #13
0
 *
 * You should have received a copy of the GNU General Public License
 * along with playSMS. If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');
if (!auth_isadmin()) {
    auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/openvox/config.php";
$callback_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/plugin/gateway/openvox/callback.php";
$callback_url = str_replace("//", "/", $callback_url);
$callback_url = "http://" . $callback_url;
switch (_OP_) {
    case "manage":
        if ($err = TRUE) {
            $error_content = _dialog();
        }
        $tpl = array('name' => 'openvox', 'vars' => array('DIALOG_DISPLAY' => $error_content, 'Manage OpenVox' => _('Manage OpenVox'), 'Gateway name' => _('Gateway name'), 'Gateway host' => _('Gateway host'), 'Gateway port' => _('Gateway port'), 'Username' => _('Username'), 'Password' => _('Password'), 'Module sender ID' => _('Module sender ID'), 'Module timezone' => _('Module timezone'), 'Save' => _('Save'), 'Notes' => _('Notes'), 'HINT_FILL_SECRET' => _hint(_('Fill to change the password')), 'CALLBACK_URL_IS' => _('Your callback URL is'), 'CALLBACK_URL_ACCESSIBLE' => _('Your callback URL should be accessible from OpenVox'), 'BUTTON_BACK' => _back('index.php?app=main&inc=core_gateway&op=gateway_list'), 'openvox_param_gateway_host' => $plugin_config['openvox']['gateway_host'], 'openvox_param_gateway_port' => $plugin_config['openvox']['gateway_port'], 'openvox_param_username' => $plugin_config['openvox']['username'], 'callback_url' => $callback_url));
        _p(tpl_apply($tpl));
        break;
    case "manage_save":
        $_SESSION['dialog']['info'][] = _('Changes have been made');
        $items = array('gateway_host' => $_POST['up_gateway_host'], 'gateway_port' => $_POST['up_gateway_port'], 'username' => $_POST['up_username'], 'password' => $_POST['up_password']);
        if ($_POST['up_password']) {
            $items['password'] = $_POST['up_password'];
        }
        registry_update(1, 'gateway', 'openvox', $items);
        header("Location: " . _u('index.php?app=main&inc=gateway_openvox&op=manage'));
        exit;
        break;
}
      <?php 
if ($user->avatar()) {
    ?>
      <figure class="avatar avatar-full avatar-centered"><img src="<?php 
    echo $user->avatar()->url() . '?' . $user->avatar()->modified();
    ?>
"></figure>
      <?php 
}
?>

    </div>

    <div class="buttons buttons-centered cf">
      <a class="btn btn-rounded btn-cancel" href="<?php 
_u($user, 'edit');
?>
"><?php 
_l('cancel');
?>
</a>
      <input class="btn btn-rounded btn-submit btn-negative" type="submit" value="<?php 
_l('delete');
?>
" autofocus>
    </div>

  </form>
</div>
Example #15
0
                    $db_query = "UPDATE " . _DB_PREF_ . "_featureMsgtemplate SET c_timestamp='" . mktime() . "',t_title='{$t_title}', t_text='{$t_text}' WHERE tid='{$tid}'";
                    $db_result = dba_affected_rows($db_query);
                    if ($db_result > 0) {
                        $_SESSION['dialog']['info'][] = _('Message template has been edited');
                    } else {
                        $_SESSION['dialog']['info'][] = _('Fail to edit message template');
                    }
                } else {
                    $_SESSION['dialog']['info'][] = _('You must fill all fields');
                }
                header("Location: " . _u('index.php?app=main&inc=feature_msgtemplate&op=list'));
                exit;
                break;
            case "delete":
                $item_count = $_POST['item_count'];
                for ($i = 1; $i <= $item_count; $i++) {
                    $chkid[$i] = $_POST['chkid' . $i];
                    $chkid_value[$i] = $_POST['chkid_value' . $i];
                }
                for ($i = 1; $i <= $item_count; $i++) {
                    if ($chkid[$i] == 'on' && $chkid_value[$i]) {
                        $db_query = "DELETE FROM " . _DB_PREF_ . "_featureMsgtemplate WHERE tid='" . $chkid_value[$i] . "'";
                        $db_result = dba_affected_rows($db_query);
                    }
                }
                $_SESSION['dialog']['info'][] = _('Selected message template has been deleted');
                header("Location: " . _u('index.php?app=main&inc=feature_msgtemplate&op=list'));
                exit;
                break;
        }
}
    </a>
    <?php 
if (count_user_notifications()) {
    ?>
        <div class="dropdown-menu" id="notification-panel">

            <div class="dropdown-header">
                <span class="title"><?php 
    __('Notification');
    ?>
 <span class="count">(<?php 
    echo count_user_notifications();
    ?>
)</span></span>
                <span class="option text-right"><a href="<?php 
    _u('admin/dashboard/clear_notice');
    ?>
"><?php 
    __('Clear all');
    ?>
</a></span>
            </div>
            <div class="media-list slimScroll">
                <?php 
    echo get_user_notifications();
    ?>
            </div>

        </div>
    <?php 
}
Example #17
0
        $acl_disallowed = (int) $_REQUEST['acl_disallowed'];
        $url = trim($_POST['url']);
        if ($id) {
            $db_query = "\n\t\t\t\tUPDATE " . _DB_PREF_ . "_tblACL SET c_timestamp='" . mktime() . "',acl_subuser='******',url='" . $url . "',flag_disallowed='" . $acl_disallowed . "'\n\t\t\t\tWHERE id='" . $id . "'";
            if ($new_id = @dba_affected_rows($db_query)) {
                $_SESSION['dialog']['info'][] = _('ACL been edited');
            } else {
                $_SESSION['dialog']['info'][] = _('Fail to edit ACL');
            }
        } else {
            $_SESSION['dialog']['info'][] = _('Mandatory fields must not be empty');
        }
        header("Location: " . _u('index.php?app=main&inc=core_acl&op=edit&id=' . $id));
        exit;
        break;
    case "del":
        $id = $_REQUEST['id'];
        if ($id && dba_isexists(_DB_PREF_ . "_tblACL", array('id' => $id), 'AND')) {
            $db_query = "UPDATE " . _DB_PREF_ . "_tblACL SET c_timestamp='" . mktime() . "', flag_deleted='1' WHERE id='{$id}'";
            if (@dba_affected_rows($db_query)) {
                $_SESSION['dialog']['info'][] = _('ACL has been deleted');
            } else {
                $_SESSION['dialog']['info'][] = _('Fail to delete ACL');
            }
        } else {
            auth_block();
        }
        header("Location: " . _u('index.php?app=main&inc=core_acl&op=acl_list'));
        exit;
        break;
}
Example #18
0
    i('arrow-circle-left', 'left') . _l('users.form.back');
    ?>
      </a>

      <?php 
} else {
    ?>
      <h2 class="hgroup hgroup-single-line hgroup-compressed cf">
        <span class="hgroup-title"><?php 
    _l('users.index.add');
    ?>
</span>
      </h2>

      <a class="btn btn-with-icon" href="<?php 
    _u('users');
    ?>
">
        <?php 
    i('arrow-circle-left', 'left') . _l('users.form.back');
    ?>
      </a>
      <?php 
}
?>

    </div>
  </div>

  <div class="mainbar">
    <div class="section">
Example #19
0
if ($errors) {
    ?>
  <ol class="thumbs">
<?php 
    foreach ($errors as $id => $name) {
        ?>
    <li>
      <a href="<?php 
        _u("/{$id}");
        ?>
" title="<?php 
        _e($name);
        ?>
">
        <img src="<?php 
        _u("/img/{$id}/thumb");
        ?>
" alt="<?php 
        _e($name);
        ?>
" />
      </a>
    </li>
<?php 
    }
    ?>
  </ol>
<?php 
} else {
    ?>
  <p><?php 
Example #20
0
function flatly_hook_themes_navbar($num, $nav, $max_nav, $url, $page)
{
    global $core_config;
    $nav_pages = "";
    if ($num) {
        $nav_start = ($nav - 1) * $max_nav + 1;
        $nav_end = $nav * $max_nav;
        $start = 1;
        $end = ceil($num / $max_nav);
        $nav_pages = "<div class=playsms-nav-bar>";
        $nav_pages .= "<a href='" . _u($url . '&page=1&nav=1') . "'> << </a>";
        $nav_pages .= $start == $nav ? " < " : "<a href='" . _u($url . '&page=' . (($nav - 2) * $max_nav + 1) . '&nav=' . ($nav - 1)) . "'> < </a>";
        $nav_pages .= $start == $nav ? "" : " ... ";
        for ($i = $nav_start; $i <= $nav_end; $i++) {
            if ($i > $num) {
                break;
            }
            if ($i == $page) {
                $nav_pages .= "<u>{$i}</u> ";
            } else {
                $nav_pages .= "<a href='" . _u($url . '&page=' . $i . '&nav=' . $nav) . "'>" . $i . "</a> ";
            }
        }
        $nav_pages .= $end == $nav ? "" : "..";
        $nav_pages .= $end == $nav ? " > " : "<a href='" . _u($url . '&page=' . ($nav * $max_nav + 1) . '&nav=' . ($nav + 1)) . "'> > </a>";
        $nav_pages .= "<a href='" . _u($url . '&page=' . $num . '&nav=' . $end) . "'> >> </a>";
        $nav_pages .= "</div>";
    }
    return $nav_pages;
}
Example #21
0
        <li>
          <a href="<?php 
        _u($user, 'delete-avatar');
        ?>
">
            <?php 
        i('trash-o', 'left') . _l('users.form.avatar.delete');
        ?>
          </a>
        </li>
        <?php 
    } else {
        ?>
        <li>
          <a href="<?php 
        _u($user, 'avatar');
        ?>
">
            <?php 
        i('cloud-upload', 'left') . _l('users.form.avatar.upload');
        ?>
          </a>
        </li>
        <?php 
    }
    ?>

      </ul>

      <?php 
} elseif ($user and !$writable) {
Example #22
0
    case "manage":
        if ($err = TRUE) {
            $error_content = _dialog();
        }
        $tpl = array('name' => 'generic', 'vars' => array('DIALOG_DISPLAY' => $error_content, 'Manage generic' => _('Manage generic'), 'Gateway name' => _('Gateway name'), 'Generic send SMS URL' => _mandatory(_('Generic send SMS URL')), 'Callback URL' => _('Callback URL'), 'API username' => _mandatory(_('API username')), 'API password' => _('API password'), 'Module sender ID' => _('Module sender ID'), 'Module timezone' => _('Module timezone'), 'Save' => _('Save'), 'Notes' => _('Notes'), 'HINT_CALLBACK_URL' => _hint(_('Empty callback URL to set default')), 'HINT_FILL_PASSWORD' => _hint(_('Fill to change the API password')), 'HINT_MODULE_SENDER' => _hint(_('Max. 16 numeric or 11 alphanumeric char. empty to disable')), 'HINT_TIMEZONE' => _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')), 'CALLBACK_URL_IS' => _('Your current callback URL is'), 'CALLBACK_URL_ACCESSIBLE' => _('Your callback URL should be accessible from Generic'), 'GENERIC_PUSH_DLR' => _('Generic will push DLR and incoming SMS to your callback URL'), 'BUTTON_BACK' => _back('index.php?app=main&inc=core_gateway&op=gateway_list'), 'status_active' => $status_active, 'generic_param_url' => $plugin_config['generic']['url'], 'generic_param_callback_url' => $plugin_config['generic']['callback_url'], 'generic_param_api_username' => $plugin_config['generic']['api_username'], 'generic_param_module_sender' => $plugin_config['generic']['module_sender'], 'generic_param_datetime_timezone' => $plugin_config['generic']['datetime_timezone']));
        _p(tpl_apply($tpl));
        break;
    case "manage_save":
        $up_url = $_REQUEST['up_url'] ? $_REQUEST['up_url'] : $plugin_config['generic']['default_url'];
        $up_callback_url = $_REQUEST['up_callback_url'] ? $_REQUEST['up_callback_url'] : $plugin_config['generic']['default_callback_url'];
        $up_api_username = $_REQUEST['up_api_username'];
        $up_api_password = $_REQUEST['up_api_password'];
        $up_module_sender = $_REQUEST['up_module_sender'];
        $up_datetime_timezone = $_REQUEST['up_datetime_timezone'];
        if ($up_url && $up_api_username) {
            $items = array('url' => $up_url, 'callback_url' => $up_callback_url, 'api_username' => $up_api_username, 'module_sender' => $up_module_sender, 'datetime_timezone' => $up_datetime_timezone);
            if ($up_api_password) {
                $items['api_password'] = $up_api_password;
            }
            if (registry_update(0, 'gateway', 'generic', $items)) {
                $_SESSION['dialog']['info'][] = _('Gateway module configurations has been saved');
            } else {
                $_SESSION['dialog']['danger'][] = _('Fail to save gateway module configurations');
            }
        } else {
            $_SESSION['dialog']['danger'][] = _('All mandatory fields must be filled');
        }
        header("Location: " . _u('index.php?app=main&inc=gateway_generic&op=manage'));
        exit;
        break;
}
Example #23
0
  <div class="mainbar">

    <div class="section">
      <form class="form" method="post" autocomplete="off">

        <fieldset class="fieldset field-grid cf">
          <?php 
foreach ($form->fields() as $field) {
    echo $field;
}
?>
        </fieldset>

        <div class="buttons cf">
          <a class="btn btn-rounded btn-cancel" href="<?php 
_u();
?>
"><?php 
_l('cancel');
?>
</a>
          <input class="btn btn-rounded btn-submit" type="submit" data-saved="<?php 
_l('saved');
?>
" value="<?php 
echo l('save');
?>
">
        </div>

      </form>
Example #24
0
        $id = $_REQUEST['id'];
        // destination ID
        $schedule_id = $_REQUEST['schedule_id'];
        // schedule ID
        $db_query = "SELECT * FROM " . _DB_PREF_ . "_featureSchedule WHERE uid='" . $user_config['uid'] . "' AND id='{$schedule_id}' AND flag_deleted='0'";
        $db_result = dba_query($db_query);
        $db_row = dba_fetch_array($db_result);
        $schedule_name = $db_row['name'];
        $schedule_message = $db_row['message'];
        if ($id && $schedule_id && $schedule_name && $schedule_message) {
            $name = $_POST['name'];
            $destination = $_POST['destination'];
            $schedule = trim($_POST['schedule']);
            if ($name && $destination && $schedule) {
                $schedule = $schedule ? core_adjust_datetime($schedule) : '0000-00-00 00:00:00';
                $db_query = "\n\t\t\t\t\tUPDATE " . _DB_PREF_ . "_featureSchedule_dst\n\t\t\t\t\tSET c_timestamp='" . mktime() . "',name='{$name}',destination='{$destination}',schedule='{$schedule}',scheduled='0000-00-00 00:00:00'\n\t\t\t\t\tWHERE schedule_id='{$schedule_id}' AND id='{$id}'";
                if (@dba_affected_rows($db_query)) {
                    $_SESSION['dialog']['info'][] = _('Destination has been edited');
                } else {
                    $_SESSION['dialog']['info'][] = _('Fail to edit destination');
                }
            } else {
                $_SESSION['dialog']['info'][] = _('Mandatory fields must not be empty');
            }
            header("Location: " . _u('index.php?app=main&inc=feature_schedule&route=manage&op=dst_edit&schedule_id=' . $schedule_id . '&id=' . $id));
            exit;
        } else {
            auth_block();
        }
        break;
}
Example #25
0
echo form_input(array('class' => 'form-control', 'name' => 'title', 'value' => isset($section->title) ? $section->title : ''));
?>
                    </div>
                    <div class="field-row">
                        <?php 
echo form_label(lang('Access'), 'access[]');
echo form_multiselect('access[]', access_A(), isset($section->access) ? explode(',', $section->access) : array(1), 'class="form-control"');
?>
                    </div>
                </div>
                <div class="panel-footer text-right">
                    <?php 
echo isset($section->id) ? form_hidden('id', $section->id) : '';
?>
                    <a href="<?php 
_u('admin/settings');
?>
" class="btn btn-default btn-sm">
                        <i class="fa fa-arrow-circle-left"></i>
                        <?php 
__('Cancel');
?>
                    </a>
                    <button type="submit" class="btn btn-primary">
                        <i class="fa fa-save"></i>
                        <?php 
__('Save');
?>
                    </button>
                </div>
            </div>
Example #26
0
            $c_count = $data[$c]['sms_count'];
            $c_message = stripslashes(core_display_text($data[$c]['message']));
            $c_action = "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to delete queue")) . " " . $c_queue_code . " ?','" . _u('index.php?app=main&inc=feature_queuelog&op=queuelog_delete&queue=' . $c_queue_code) . "')\">" . $icon_config['delete'] . "</a>";
            $content .= "\n\t\t\t\t<tr>\n\t\t\t";
            if (auth_isadmin()) {
                $content .= "\n\t\t\t\t\t<td>" . $c_queue_code . "</td>\n\t\t\t\t\t<td>" . $c_username . "</td>\n\t\t\t\t";
            } else {
                $content .= "\n\t\t\t\t\t<td>" . $c_queue_code . "</td>\n\t\t\t\t";
            }
            $content .= "\n\t\t\t\t\t<td>" . $c_datetime_scheduled . "</td>\n\t\t\t\t\t<td>" . $c_count . "</td>\n\t\t\t\t\t<td>" . $c_message . "</td>\n\t\t\t\t\t<td>" . $c_action . "</td>\n\t\t\t\t</tr>\n\t\t\t";
        }
        $content .= "\n\t\t\t</tbody></table>\n\t\t\t</div>\n\t\t\t<div align=center>" . $nav['form'] . "</div>\n\t\t";
        _p($content);
        break;
    case "queuelog_delete":
        if ($queue = $_REQUEST['queue']) {
            if (queuelog_delete($queue)) {
                $_SESSION['dialog']['info'][] = _('Queue has been removed');
            }
        }
        header("Location: " . _u('index.php?app=main&inc=feature_queuelog&op=queuelog_list'));
        exit;
        break;
    case "queuelog_delete_all":
        if (queuelog_delete_all($queue)) {
            $_SESSION['dialog']['info'][] = _('All queues have been removed');
        }
        header("Location: " . _u('index.php?app=main&inc=feature_queuelog&op=queuelog_list'));
        exit;
        break;
}
Example #27
0
 * You should have received a copy of the GNU General Public License
 * along with playSMS.  If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');
if (!auth_isvalid()) {
    auth_block();
}
switch (_OP_) {
    case "sms_sync_list":
        $list = registry_search($user_config['uid'], 'feature', 'sms_sync');
        $sms_sync_secret = $list['feature']['sms_sync']['secret'];
        if ($list['feature']['sms_sync']['enable']) {
            $option_enable = 'checked';
        }
        $sync_url = $core_config['http_path']['base'] . '/plugin/feature/sms_sync/sync.php?uid=' . $user_config['uid'];
        unset($tpl);
        $tpl = array('name' => 'sms_sync', 'vars' => array('DIALOG_DISPLAY' => _dialog(), 'HINT_SECRET' => _hint(_('Secret key is used in SMSSync app')), 'HINT_ENABLE' => _hint(_('Check to enable receiving push messages from SMSSync app')), 'SECRET' => $sms_sync_secret, 'CHECKED' => $option_enable, 'SYNC_URL' => $sync_url, 'Manage sync' => _('Manage sync'), 'Secret key' => _('Secret key'), 'Enable SMS Sync' => _('Enable SMS Sync'), 'Sync URL' => _('Sync URL'), 'Notes' => _('Notes'), 'Download SMSSync app for Android from' => _('Download SMSSync app for Android from'), 'Save' => _('Save')));
        _p(tpl_apply($tpl));
        break;
    case "sms_sync_save":
        $items['secret'] = $_POST['sms_sync_secret'];
        $items['enable'] = trim($_POST['sms_sync_enable']) ? 1 : 0;
        if (registry_update($user_config['uid'], 'feature', 'sms_sync', $items)) {
            $_SESSION['dialog']['info'][] = _('SMS Sync configuration has been saved');
        } else {
            $_SESSION['dialog']['info'][] = _('Fail to save SMS Sync configuration');
        }
        header("Location: " . _u('index.php?app=main&inc=feature_sms_sync&op=sms_sync_list'));
        exit;
        break;
}
Example #28
0
                    $j = $i + 1;
                    $data[$j] = array($list[$i]['username'], $list[$i]['p_gateway'], $list[$i]['p_smsc'], core_display_datetime($list[$i]['p_datetime']), $list[$i]['p_dst'], $list[$i]['p_msg'] . $list[$i]['p_footer'], $list[$i]['p_status']);
                }
                $content = core_csv_format($data);
                if ($queue_code) {
                    $fn = 'all_outgoing-' . $core_config['datetime']['now_stamp'] . '-' . $queue_code . '.csv';
                } else {
                    $fn = 'all_outgoing-' . $core_config['datetime']['now_stamp'] . '.csv';
                }
                core_download($content, $fn, 'text/csv');
                break;
            case 'delete':
                for ($i = 0; $i < $nav['limit']; $i++) {
                    $checkid = $_POST['checkid' . $i];
                    $itemid = $_POST['itemid' . $i];
                    if ($checkid == "on" && $itemid) {
                        $up = array('c_timestamp' => mktime(), 'flag_deleted' => '1');
                        $conditions = array('smslog_id' => $itemid);
                        if ($queue_code = trim($_REQUEST['queue_code'])) {
                            $conditions['queue_code'] = $queue_code;
                        }
                        dba_update(_DB_PREF_ . '_tblSMSOutgoing', $up, $conditions);
                    }
                }
                $ref = $nav['url'] . '&search_keyword=' . $search['keyword'] . '&page=' . $nav['page'] . '&nav=' . $nav['nav'];
                $_SESSION['dialog']['info'][] = _('Selected outgoing message has been deleted');
                header("Location: " . _u($ref));
                exit;
        }
        break;
}
Example #29
0
<!DOCTYPE html>
<html lang="<?php 
echo language_code();
?>
">

    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        
        <meta name="site_url" content="<?php 
_u('');
?>
">
        
        <meta name="description" content="<?php 
echo isset($meta_description) ? $meta_description : AZ::setting('global_meta_description');
?>
">
        <meta name="keywords" content="<?php 
echo isset($meta_keywords) ? $meta_keywords : AZ::setting('global_meta_keywords');
?>
">
		
		<link rel="shortcut icon" href="<?php 
echo skin_url();
?>
images/favicon.ico" type="image/x-icon">
Example #30
0
        // option enable fetch
        $option_enable_fetch = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['enable_fetch']);
        // option check email sender
        $option_check_sender = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['check_sender']);
        // option protocol
        $option_protocol = _options(array('IMAP' => 'imap', 'POP3' => 'pop3'), $items_global['features']['mailsms']['protocol']);
        // option ssl
        $option_ssl = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['ssl']);
        // option cert
        $option_novalidate_cert = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['novalidate_cert']);
        $tpl = array('name' => 'mailsms', 'vars' => array('ERROR' => _err_display(), 'FORM_TITLE' => _('Manage email to SMS'), 'ACTION_URL' => _u('index.php?app=main&inc=feature_mailsms&op=mailsms_save'), 'HTTP_PATH_THEMES' => _HTTP_PATH_THEMES_, 'HINT_PASSWORD' => _hint(_('Fill the password field to change password')), 'Email to SMS address' => _('Email to SMS address'), 'Enable fetch new emails' => _('Enable fetch new emails'), 'Check email sender' => _('Check email sender'), 'Email protocol' => _('Email protocol'), 'Use SSL' => _('Use SSL'), 'No validate cert option' => _('No validate cert option'), 'Mail server address' => _('Mail server address'), 'Mail server port' => _('Mail server port'), 'Mailbox username' => _('Mailbox username'), 'Mailbox password' => _('Mailbox password'), 'PORT_DEFAULT' => '443', 'PORT_DEFAULT_SSL' => '993'), 'injects' => array('option_enable_fetch', 'option_check_sender', 'option_protocol', 'option_ssl', 'option_novalidate_cert', 'items_global'));
        _p(tpl_apply($tpl));
        break;
    case "mailsms_save":
        $items_global = array('email' => $_REQUEST['email'], 'enable_fetch' => $_REQUEST['enable_fetch'], 'check_sender' => $_REQUEST['check_sender'], 'protocol' => $_REQUEST['protocol'], 'ssl' => $_REQUEST['ssl'], 'novalidate_cert' => $_REQUEST['novalidate_cert'], 'port' => $_REQUEST['port'], 'server' => $_REQUEST['server'], 'username' => $_REQUEST['username'], 'hash' => md5($_REQUEST['username'] . $_REQUEST['server'] . $_REQUEST['port']));
        if ($_REQUEST['password']) {
            $items_global['password'] = $_REQUEST['password'];
        }
        registry_update(0, 'features', 'mailsms', $items_global);
        if ($_REQUEST['enable_fetch']) {
            $enabled = 'enabled';
            $_SESSION['error_string'] = _('Email to SMS configuration has been saved and service enabled');
        } else {
            $enabled = 'disabled';
            $_SESSION['error_string'] = _('Email to SMS configuration has been saved and service disabled');
        }
        _log($enabled . ' server:' . $_REQUEST['server'], 2, 'mailsms');
        header("Location: " . _u('index.php?app=main&inc=feature_mailsms&op=mailsms'));
        exit;
        break;
}