コード例 #1
0
ファイル: admin_sys_opts.php プロジェクト: jhawcroft/jxbot
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*******************************************************************************/
if (!defined('JXBOT_ADMIN')) {
    die('Direct script access not permitted.');
}
if (isset($_POST['action']) && $_POST['action'] == 'save') {
    JxBotConfig::set_option('bot_tz', $_POST['bot_tz']);
    //JxBotConfig::set_option('bot_active', $_POST['bot_active']);
    JxBotConfig::set_option('pre_strip_accents', $_POST['pre_strip_accents']);
    JxBotConfig::set_option('sys_cap_bot_ipm', $_POST['sys_cap_bot_ipm']);
    //JxBotConfig::set_option('admin_user', $_POST['admin_user']);
    JxBotConfig::set_option('admin_timeout', intval($_POST['admin_timeout']));
    //if (isset($_POST['bot_password']) && trim($_POST['bot_password']) !== '')
    //	JxBotConfig::set_option('admin_hash', hash('sha256', $_POST['bot_password']));
    JxBotConfig::save_configuration();
}
?>

<h2>Setup</h2>

<div class="field"><label for="bot_tz">Timezone: </label>
<?php 
JxBotConfig::widget_timezone();
?>
</div>

コード例 #2
0
ファイル: admin_bot.php プロジェクト: jhawcroft/jxbot
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*******************************************************************************/
if (!defined('JXBOT_ADMIN')) {
    die('Direct script access not permitted.');
}
JxWidget::tabs(array(array('General', '?page=bot', 'subpage', ''), array('Predicates', '?page=bot&subpage=pred', 'subpage', 'pred')));
$subpage = JxBotUtil::inputs('subpage');
if ($subpage['subpage'] == 'pred') {
    require_once 'admin_bot_pred.php';
} else {
    if (isset($_POST['bot_name'])) {
        //JxBotConfig::set_option('bot_name', $_POST['bot_name']);
        foreach ($_POST as $key => $value) {
            if (substr($key, 0, 4) == 'bot_') {
                JxBotConfig::set_option($key, $value);
            }
        }
        JxBotConfig::save_configuration();
    }
    ?>

<p><div class="field"><label for="bot_name">Bot Name: </label>
<input type="text" name="bot_name" id="bot_name" size="40" value="<?php 
    print JxBotConfig::option('bot_name');
    ?>
"></div></p>

<div class="field"><label for="bot_birthday">Birthday: </label>
<input type="text" name="bot_birthday" id="bot_birthday" size="12" value="<?php 
    print JxBotConfig::option('bot_birthday');
コード例 #3
0
ファイル: install.php プロジェクト: jhawcroft/jxbot
 private static function do_install(&$out_msgs)
 {
     $inputs = JxBotUtil::inputs('db_host,db_name,db_prefix,db_username,db_password,bot_tz,bot_name,admin_password');
     // database configuration
     if (!JxBotInstaller::try_write_config()) {
         return 'manual';
     }
     if (!JxBotConfig::load_config()) {
         return 'manual';
     }
     // database connection
     if (!JxBotConfig::try_connect_db()) {
         $out_msgs = 'Unable to connect to the database with the specified settings.  Please check the settings and try again.';
         return 'welcome';
     }
     // schema creation
     require_once dirname(__FILE__) . '/schema.php';
     JxBotSchema::install();
     // configure system
     JxBotConfig::set_option('bot_name', $inputs['bot_name']);
     JxBotConfig::set_option('bot_tz', $inputs['bot_tz']);
     JxBotConfig::set_option('admin_hash', hash('sha256', $inputs['admin_password']));
     JxBotConfig::save_configuration();
     return 'complete';
 }
コード例 #4
0
ファイル: admin_system.php プロジェクト: jhawcroft/jxbot
} else {
    if ($subpage['subpage'] == 'about') {
        require_once 'admin_about.php';
    } else {
        if ($subpage['subpage'] == 'opts') {
            require_once 'admin_sys_opts.php';
        } else {
            if (isset($_POST['action']) && $_POST['action'] == 'save') {
                //JxBotConfig::set_option('bot_tz', $_POST['bot_tz']);
                JxBotConfig::set_option('bot_active', $_POST['bot_active']);
                //JxBotConfig::set_option('pre_strip_accents', $_POST['pre_strip_accents']);
                //JxBotConfig::set_option('sys_cap_bot_ipm', $_POST['sys_cap_bot_ipm']);
                JxBotConfig::set_option('admin_user', $_POST['admin_user']);
                //JxBotConfig::set_option('admin_timeout', intval($_POST['admin_timeout']));
                if (isset($_POST['bot_password']) && trim($_POST['bot_password']) !== '') {
                    JxBotConfig::set_option('admin_hash', hash('sha256', $_POST['bot_password']));
                }
                JxBotConfig::save_configuration();
            }
            ?>


<div class="field"><label for="bot_active">Online:</label>
<?php 
            JxWidget::toggle_switch('bot_active', JxBotConfig::option('bot_active'));
            ?>
</div>


<div class="field"><label for="admin_user">Administration Username: </label>
<input type="text" name="admin_user" id="admin_user" size="20" value="<?php 
コード例 #5
0
ファイル: config.php プロジェクト: jhawcroft/jxbot
 public static function def_add_pred($in_name)
 {
     $prop_id = str_replace(' ', '_', strtolower(trim($in_name)));
     JxBotConfig::set_option('def_' . $prop_id, '');
 }