function PathStuffController()
 {
     if (isset($_SESSION['settings']['ROOT_PATH'])) {
         $this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
     } else {
         $path = str_replace("\\", "/", @realpath('../'));
         if (file_exists("{$path}/mainfile.php")) {
             $this->xoopsRootPath = $path;
         }
     }
     if (isset($_SESSION['settings']['TRUST_PATH'])) {
         $this->xoopsTrustPath = $_SESSION['settings']['TRUST_PATH'];
     } else {
         $web_root = dirname($this->xoopsRootPath);
         $arr = explode('/', $web_root);
         $web_root = '';
         for ($i = 0; $i < count($arr) - 1; $i++) {
             $web_root .= $arr[$i] . '/';
         }
         $docroot = resolveDocumentRoot();
         $this->xoopsTrustPath = $docroot . substr(md5(time()), 0, 15);
     }
     if (isset($_SESSION['settings']['URL'])) {
         $this->xoopsUrl = $_SESSION['settings']['URL'];
     } else {
         $path = $GLOBALS['wizard']->baseLocation();
         $this->xoopsUrl = substr($path, 0, strrpos($path, '/'));
     }
 }
예제 #2
0
    {
        $current_script = dirname($_SERVER['SCRIPT_NAME']);
        $current_path = dirname($_SERVER['SCRIPT_FILENAME']);
        /* work out how many folders we are away from document_root
           by working out how many folders deep we are from the url.
           this isn't fool proof */
        $adjust = explode("/", $current_script);
        $adjust = count($adjust) - 1;
        /* move up the path with ../ */
        $traverse = str_repeat("../", $adjust);
        $adjusted_path = sprintf("%s/%s", $current_path, $traverse);
        /* real path expands the ../'s to the correct folder names */
        return realpath($adjusted_path);
    }
}
$dir_base = resolveDocumentRoot();
$url_base = 'http://' . $_SERVER['HTTP_HOST'];
if ($dossiers = scandir($dir_base)) {
    foreach ($dossiers as $dossier) {
        if (is_dir($dir_base . "/" . $dossier) && file_exists($dir_base . "/" . $dossier . "/wakka.config.php")) {
            include $dir_base . "/" . $dossier . "/wakka.config.php";
            echo $this->format("[[" . $wakkaConfig['base_url'] . " " . $wakkaConfig['wakka_name'] . "]]"), " ";
            echo $this->format("[[" . $wakkaConfig['base_url'] . "DerniersChangementsRSS/xml (RSS)]]"), "<br />\n";
        }
    }
    // OPML : TODO generer fichier
    /*
    echo "<head>" , "\n";
    echo "<title>",$url_base,"</title>" , "\n";                                                                                                                                            
    	    echo "</head>" , "\n";
    echo "<body>" , "\n";
예제 #3
0
파일: index.php 프로젝트: jewelhuq/myitcrm1
         if (!touch("../../cache/lock")) {
             echo "<tr><td colspan=\"2\"><font color=\"red\">Failed to create lock file. Please create a file name lock and put it in the cache folder !!</font></td></tr>";
         }
         /* done */
         echo "<tr>\n<td colspan=\"2\"><font size=\\+2 color=\"red\">Your Upgrade was successful to v0.2.9.2.</font>\r\n\t\t\t\t<br><br>\r\n\t\t\t\tThere are still a few steps that need to be completed.<br>\r\n\t\t\t\t1. You need to move or rename the upgrade directory. We recommend deleting this folder.<br>\r\n                                2. You then need to login as an administrator and setup the additional information under the Business Setup>>Business Setup Menu option.<br>\r\n\t\t\t\t3. You can now resume your normal operation mode.\r\n\t\t\t\t<br><br>\r\n\t\t\t\tWhere to find help:<br>\r\n\t\t\t\tThe user Documentation is at <a href=\"http://wiki.myitcrm.com\">http://wiki.myitcrm.com/</a><br>\r\n\t\t\t\tBug/Feature Reporting is at <a href=\"http://team.myitcrm.com/projects/main/issues/new\">Bug Tracker</a><br>\r\n\r\n\t\t\t\t</td>\n</tr>\n";
     }
     echo "\r\n\t\t\t\t\t\t\t\t\t</table>\n\r\n\t\t\t\t\t\t\t\t</td>\n\r\n\t\t\t\t\t\t\t</tr>\n\r\n\t\t\t\t\t\t</table>\n\r\n\r\n\t\t\t\t\t</td>\n\r\n\t\t\t\t</tr>\n\r\n\t\t\t</table>\n\r\n\t\t</td>\n\r\n\t</tr>\n\r\n</table>\n\r\n\t\t\t<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td height=\"51\" align=\"center\" background=\"../../images/index41.gif\"></td>\n\r\n\t\t\t\t</tr><tr>\n\r\n\t\t\t\t\t<td height=\"48\" align=\"center\" background=\"../../images/index42.gif\"><span class=\"text3\"></a>\r\n\t\t\t\t\t\t\t\tAll rights reserved.</span></td>\n\r\n\t\t\t\t</tr><tr>\n\r\n\t\t\t\t\t<td>&nbsp;</td>\n\r\n\t\t\t\t</tr>\n\r\n\t\t\t</table>\n\r\n\t\t</td>\n\r\n\t</tr>\n\r\n</table>\n\r\n</center>\n\r\n\r\n</body>\n\r\n</html>\n";
     break;
     ################################
     #		Default						#
     ###############################
 ################################
 #		Default						#
 ###############################
 default:
     $default_path = resolveDocumentRoot();
     $default_server = get_server_name();
     echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\r\n<html>\r\n<head>\r\n\t<title>MYIT CRM Upgrader</title>\r\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n\t<link type=\"text/css\" href=\"../../css/default.css\" rel=\"stylesheet\">";
     echo "\r\n</head>\r\n<body>\r\n<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\r\n\t<tr>\r\n\t\t<td colspan=\"3\" background=\"../../images/index03.gif\"><img src=\"../../images/index03.gif\" alt=\"\" width=\"100%\" height=\"40\"></td>\r\n\t</tr><tr>\r\n\t\t<td align=\"center\">\r\n\t\t<br><br>\r\n\r\n<table width=\"55%\" border=\"0\" cellpadding=\"20\" cellspacing=\"0\">\r\n\t<tr>\r\n\t\t<td class=\"olotd\" align=\"center\">\r\n\t\t\t\r\n\t\t\t<!-- Begin Page -->\r\n\t\t\t<table width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" >\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"menuhead2\" width=\"100%\">&nbsp;MyIT CRM Upgrader from versions 0.2.9.x</td>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr><tr>\r\n\t\t\t\t\t<td class=\"menutd2\" colspan=\"2\">\r\n\r\n\t\t\t\t\t\t<table width=\"100%\" class=\"olotable\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" >\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td width=\"100%\" valign=\"top\" >\r\n\r\n\t\t\t\t\t\t\t\t\t<form action=\"index.php\" method=\"POST\" name=\"install\" id=\"install\" onsubmit=\"try   { var myValidator = validate_install; } catch(e) { return true; } return myValidator(this);\">\r\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"mode\" value=\"install\">\r\n\r\n\t\t\t\t\t\t\t\t\t\t<table width=\"100%\" class=\"menutd\" cellspacing=\"0\"  border=\"0\" cellpadding=\"5\">\r\n\t\t\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<table >\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b>Initial File Checks</b><br>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<table class=\"olotable\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" >\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou need to set the config file conf.php to be writable by your webserver for the install after that you must make them read only by your webserver.\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tThe file log/access.log needs to be writable by the web server. The cache directory needs to be writable by the server.\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr><tr>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td align=\"left\">Main Config Writable ";
     if (!check_write('../../conf.php')) {
         echo "<font color=\"red\">../../conf.php is not writable stopping</font>";
         $errors[] = array('../../conf.php' => 'Not Writable');
     } else {
         echo "<font color=\"green\"><b>OK</b>";
     }
     echo "</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr><tr>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td align=\"left\">Cache Folder ";
     if (!check_write('../../cache')) {
         echo "<font color=\"red\">../../cache is not writable stopping.</font>";
         $errors[] = array('../../cache' => 'Not Writable');
     } else {
         echo "<font color=\"green\"><b>OK</b>";