示例#1
0
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>


<h2>Language Processing</h2>

<div class="field"><label for="pre_strip_accents">Strip Accents:</label>
示例#2
0
 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';
 }