Ejemplo n.º 1
0
 | This program 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 this program; if not, write to the Free Software              |
 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.|
 +--------------------------------------------------------------------------+
*/
require_once "login.php";
// forward to index.php in mu mode and if this page is disabled
if ($_SESSION['multi_user_mode'] && !$PMBP_MU_CONF['allow_sql_queries']) {
    header("Location: index.php");
}
PMBP_print_header(preg_replace("#.*/#", "", $_SERVER['SCRIPT_NAME']));
// used variables
$sql_print = FALSE;
if (!isset($_POST['sql_query'])) {
    $_POST['sql_query'] = FALSE;
}
if (!isset($_POST['sql_file'])) {
    $_POST['sql_file'] = FALSE;
}
if (!isset($_FILES['sql_file'])) {
    $_FILES['sql_file'] = FALSE;
}
// if first use or no db-connection is possible
if (!($con = @mysql_connect($CONF['sql_host'], $CONF['sql_user'], $CONF['sql_passwd']))) {
    echo "<div class=\"red_left\">" . I_SQL_ERROR . "</div><br>";
}
Ejemplo n.º 2
0
// set the timelimit
@set_time_limit($CONF['timelimit']);
@ignore_user_abort(TRUE);
if ($mode == "incl") {
    // save the new timestamp
    if ($_SESSION['wss'] < 0) {
        $PMBP_SYS_VAR['last_scheduled'] = time();
    } else {
        $PMBP_SYS_VAR['last_scheduled_' . $_SESSION['wss']] = time();
    }
    // update global_conf.php
    PMBP_save_global_conf();
}
// print html if web mode
if ($mode == "web") {
    PMBP_print_header(ereg_replace(".*/", "", $_SERVER['SCRIPT_NAME']));
    // if first use or no db-connection possible
    if (!@mysql_connect($CONF['sql_host'], $CONF['sql_user'], $CONF['sql_passwd'])) {
        echo "<div class=\"red\">" . I_SQL_ERROR . "</div><br>\n";
    }
    // check if ftp connection is possible
    if ($CONF['ftp_use'] || $CONF['dir_backup']) {
        if (!$CONF['ftp_server']) {
            echo "<div class=\"red\">" . C_WRONG_FTP . "</div>";
        } elseif (!($conn_id = @ftp_connect($CONF['ftp_server'], $CONF['ftp_port'], $PMBP_SYS_VAR['ftp_timeout']))) {
            echo "<div class=\"red\">" . F_FTP_1 . " '" . $CONF['ftp_server'] . "'!</div>";
        }
    }
}
// if pressed 'backup' backup the db
if ($_POST['db'] || isset($_POST['dirs']) || strlen($_POST['man_dirs'])) {