• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_dataroot_insecure函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_dataroot_insecure函数的典型用法代码示例。如果您正苦于以下问题:PHP is_dataroot_insecure函数的具体用法?PHP is_dataroot_insecure怎么用?PHP is_dataroot_insecure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_dataroot_insecure函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_context_instance

$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context);
// check that site is properly customized
$site = get_site();
if (empty($site->shortname)) {
    // probably new installation - lets return to frontpage after this step
    // remove settings that we want uninitialised
    unset_config('registerauth');
    redirect('upgradesettings.php?return=site');
}
// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
if (!empty($id) and $id == $CFG->siteidentifier) {
    set_config('registered', time());
}
// setup critical warnings before printing admin tree block
$insecuredataroot = is_dataroot_insecure(true);
$SESSION->admin_critical_warning = $insecuredataroot == INSECURE_DATAROOT_ERROR;
$adminroot = admin_get_root();
// Check if there are any new admin settings which have still yet to be set
if (any_new_admin_settings($adminroot)) {
    redirect('upgradesettings.php');
}
// Everything should now be set up, and the user is an admin
// Print default admin page with notifications.
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
$cronoverdue = $lastcron < time() - 3600 * 24;
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
$updateschecker = available_update_checker::instance();
$availableupdates = $updateschecker->get_update_info('core', array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
开发者ID:numbas,项目名称:moodle,代码行数:31,代码来源:index.php


示例2: admin_critical_warnings_present

/**
 * Test if and critical warnings are present
 * @return bool
 */
function admin_critical_warnings_present()
{
    global $SESSION;
    if (!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
        return 0;
    }
    if (!isset($SESSION->admin_critical_warning)) {
        $SESSION->admin_critical_warning = 0;
        if (is_dataroot_insecure(true) === INSECURE_DATAROOT_ERROR) {
            $SESSION->admin_critical_warning = 1;
        }
    }
    return $SESSION->admin_critical_warning;
}
开发者ID:raymondAntonio,项目名称:moodle,代码行数:18,代码来源:adminlib.php


示例3: install_print_footer

            install_print_footer($config);
            die;

        } else {
            $config->stage = INSTALL_DATABASE;
        }
    }
}



if ($config->stage == INSTALL_DOWNLOADLANG) {
    if (empty($CFG->dataroot)) {
        $config->stage = INSTALL_PATHS;

    } else if (is_dataroot_insecure()) {
        $hint_dataroot = get_string('pathsunsecuredataroot', 'install');
        $config->stage = INSTALL_PATHS;

    } else if (!file_exists($CFG->dataroot)) {
        $a = new stdClass();
        $a->parent = dirname($CFG->dataroot);
        $a->dataroot = $CFG->dataroot;
        if (!is_writable($a->parent)) {
            $hint_dataroot = get_string('pathsroparentdataroot', 'install', $a);
            $config->stage = INSTALL_PATHS;
        } else {
            if (!install_init_dataroot($CFG->dataroot, $CFG->directorypermissions)) {
                $hint_dataroot = get_string('pathserrcreatedataroot', 'install', $a);
                $config->stage = INSTALL_PATHS;
            }
开发者ID:rwijaya,项目名称:moodle,代码行数:31,代码来源:install.php


示例4: report_security_check_unsecuredataroot

/**
 * Verifies fatal misconfiguration of dataroot
 * @param bool $detailed
 * @return object result
 */
function report_security_check_unsecuredataroot($detailed = false)
{
    global $CFG;
    $result = new object();
    $result->issue = 'report_security_check_unsecuredataroot';
    $result->name = get_string('check_unsecuredataroot_name', 'report_security');
    $result->info = null;
    $result->details = null;
    $result->status = null;
    $result->link = null;
    $insecuredataroot = is_dataroot_insecure(true);
    if ($insecuredataroot == INSECURE_DATAROOT_WARNING) {
        $result->status = REPORT_SECURITY_SERIOUS;
        $result->info = get_string('check_unsecuredataroot_warning', 'report_security', $CFG->dataroot);
    } else {
        if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
            $result->status = REPORT_SECURITY_CRITICAL;
            $result->info = get_string('check_unsecuredataroot_error', 'report_security', $CFG->dataroot);
        } else {
            $result->status = REPORT_SECURITY_OK;
            $result->info = get_string('check_unsecuredataroot_ok', 'report_security');
        }
    }
    if ($detailed) {
        $result->details = get_string('check_unsecuredataroot_details', 'report_security');
    }
    return $result;
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:33,代码来源:lib.php


示例5: get_string

    }
    /// check dirroot
    if (($fh = @fopen($INSTALL['dirrootform'] . '/install.php', 'r')) === false) {
        $errormsg .= get_string('dirrooterror', 'install') . '<br />';
        $INSTALL['dirrootform'] = $INSTALL['dirroot'];
    }
    if ($fh) {
        fclose($fh);
    }
    /// check dataroot
    $CFG->dataroot = $INSTALL['dataroot'];
    $CFG->wwwroot = $INSTALL['wwwroot'];
    if (make_upload_directory('sessions', false) === false) {
        $errormsg .= get_string('datarooterror', 'install') . '<br />';
    } else {
        if (is_dataroot_insecure(true) == INSECURE_DATAROOT_ERROR) {
            $errormsg .= get_string('datarootpublicerror', 'install') . '<br />';
        }
    }
    if (!empty($errormsg)) {
        $nextstage = DIRECTORY;
    }
    error_reporting(7);
}
//==========================================================================//
/// Check database settings if stage 3 data submitted
/// Try to connect to the database. If that fails then try to create the database
if ($INSTALL['stage'] == DATABASE) {
    /// different format for postgres7 by socket
    if ($INSTALL['dbtype'] == 'postgres7' and $INSTALL['dbhost'] == 'localhost' || $INSTALL['dbhost'] == '127.0.0.1') {
        $INSTALL['dbhost'] = "user='{$INSTALL['dbuser']}' password='{$INSTALL['dbpass']}' dbname='{$INSTALL['dbname']}'";
开发者ID:NextEinstein,项目名称:riverhills,代码行数:31,代码来源:install.php


示例6: define

$INSTALL['version'] = $version;
$INSTALL['release'] = $release;
/// Have the $db object ready because we are going to use it often
define('ADODB_ASSOC_CASE', 0);
//Use lowercase fieldnames for ADODB_FETCH_ASSOC
$db =& ADONewConnection($INSTALL['dbtype']);
$db->SetFetchMode(ADODB_FETCH_ASSOC);
/// guess the www root
if ($INSTALL['wwwroot'] == '') {
    list($INSTALL['wwwroot'], $xtra) = explode('/install.php', qualified_me());
    $INSTALL['wwwrootform'] = $INSTALL['wwwroot'];
    // now try to guess the correct dataroot not accessible via web
    $CFG->wwwroot = $INSTALL['wwwroot'];
    $i = 0;
    //safety check - dirname might return some unexpected results
    while (is_dataroot_insecure()) {
        $parrent = dirname($CFG->dataroot);
        $i++;
        if ($parrent == '/' or $parrent == '.' or preg_match('/^[a-z]:\\\\?$/i', $parrent) or $i > 100) {
            $CFG->dataroot = '';
            //can not find secure location for dataroot
            break;
        }
        $CFG->dataroot = dirname($parrent) . '/moodledata';
    }
    $INSTALL['dataroot'] = $CFG->dataroot;
}
$headstagetext = array(WELCOME => get_string('chooselanguagehead', 'install'), COMPATIBILITY => get_string('compatibilitysettingshead', 'install'), DIRECTORY => get_string('directorysettingshead', 'install'), DATABASE => get_string('databasesettingshead', 'install'), ADMIN => get_string('admindirsettinghead', 'install'), ENVIRONMENT => get_string('environmenthead', 'install'), DOWNLOADLANG => get_string('downloadlanguagehead', 'install'), SAVE => get_string('configurationcompletehead', 'install'));
$substagetext = array(WELCOME => get_string('chooselanguagesub', 'install'), COMPATIBILITY => get_string('compatibilitysettingssub', 'install'), DIRECTORY => get_string('directorysettingssub', 'install'), DATABASE => get_string('databasesettingssub', 'install'), ADMIN => get_string('admindirsettingsub', 'install'), ENVIRONMENT => get_string('environmentsub', 'install'), DOWNLOADLANG => get_string('downloadlanguagesub', 'install'), SAVE => get_string('configurationcompletesub', 'install'));
//==========================================================================//
/// Are we in help mode?
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:install.php



注:本文中的is_dataroot_insecure函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_date函数代码示例发布时间:2022-05-15
下一篇:
PHP is_customize_preview函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap