*/
/*)\
\(*/
/**
 * Exit the script when IN_apcms is not defined
 */
if (!defined('IN_apcms')) {
    exit;
}
$PAGE_TITLE = $apcms['LANGUAGE']['ACTIVATE_TITLE'];
$PAGE_SUBTITLE = $apcms['LANGUAGE']['ACTIVATE_SUBTITLE'];
$smarty->caching = false;
$smarty->cache_lifetime = 1800;
$template = "main";
if (isset($_GET['key']) && trim($_GET['key']) != "" && strlen($_GET['key']) <= 32) {
    $key = apcms_Strip($_GET['key']);
    $ret = $db->unbuffered_query_first("SELECT `id`, `active` FROM `" . $apcms['table']['global']['users'] . "` WHERE `actkey`='" . apcms_ESC($key) . "'");
    if (isset($ret[0]) && intval($ret[0]) >= 1) {
        if (intval(intval($ret[1])) <= 0) {
            $query = "UPDATE `" . $apcms['table']['global']['users'] . "` SET `active`='1' WHERE `id`='" . intval($ret[0]) . "'";
            $db->unbuffered_query($query);
            $success = $apcms['LANGUAGE']['SUCCESS_ACCOUNT_ACTIVATED'];
            $apcms['redirect_url'] = $apcms['baseURL'];
            $apcms['redirect_time'] = 3;
        } else {
            $error = $apcms['LANGUAGE']['ERROR_ACTIVATE_ALREADY_ACTIVATED'];
            $apcms['redirect_url'] = $apcms['baseURL'];
            $apcms['redirect_time'] = 3;
        }
    } else {
        $error = $apcms['LANGUAGE']['ERROR_ACTIVATE_NOT_EXIST'];
Beispiel #2
0
    $COUT .= "\t\t\t\t</select>\n";
    $COUT .= "\t\t\t</td>\n";
    $COUT .= "\t\t</tr>\n";
    $COUT .= "\t\t<tr class=\"content2\">\n";
    $COUT .= "\t\t\t<td valign=\"top\">\n";
    $COUT .= "\t\t\t\t<label for=\"lang\" accesskey=\"l\" tabindex=\"3\">" . $apcms['LANGUAGE']['USER_PROFILE_LANGUAGE'] . "</label>\n";
    $COUT .= "\t\t\t</td>\n";
    $COUT .= "\t\t\t<td width=\"270\" align=\"right\" valign=\"top\">\n";
    $COUT .= "\t\t\t\t<select id=\"lang\" onfocus=\"formInUse=true;\" name=\"apcms[lang]\" style=\"width:100%\">\n";
    $fd = opendir($apcms['path'] . "/lang");
    while ($thislang = readdir($fd)) {
        if (!is_dir($apcms['path'] . "/lang/" . $thislang) && $thislang != "." && $thislang != "..") {
            $thislang = preg_replace("`^([^\\.]+)\\..*`", "\\1", $thislang);
            if (apcms_Strip($thislang) == apcms_Strip($_SESSION['language'])) {
                $COUT .= "\t\t\t\t\t<option value=\"" . $thislang . "\" selected=\"selected\">" . apcms_Strip($thislang) . "</option>\n";
            } else {
                $COUT .= "\t\t\t\t\t<option value=\"" . $thislang . "\">" . apcms_Strip($thislang) . "</option>\n";
            }
        }
    }
    closedir($fd);
    $COUT .= "\t\t\t\t</select>\n";
    $COUT .= "\t\t\t</td>\n";
    $COUT .= "\t\t</tr>\n";
    $COUT .= "\t\t<tr>\n";
    $COUT .= "\t\t\t<td colspan=\"2\" align=\"center\">\n\t\t\t\t\t\t\t<label for=\"submit\" accesskey=\"s\" tabindex=\"4\">\n\t\t\t\t\t\t\t\t<input id=\"submit\" onfocus=\"formInUse=true;\" type=\"submit\" name=\"apcms[submit]\" value=\"" . $apcms['LANGUAGE']['USER_PROFILE_SAVE'] . "\" />\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</td>\n";
    $COUT .= "\t\t</tr>\n";
    $COUT .= "\t</table>\n";
    $COUT .= "</form>\n";
    $COUT .= "</div><br />\n";
}
 */
if (!defined('IN_apcms_admin')) {
    exit;
}
/**
 * Sets the Subtitle of the page
 */
$PAGE_SUBTITLE = $apcms['LANGUAGE']['ADMIN_GENERAL_CONFIG'];
$AOUT .= "<h3>.: " . $apcms['LANGUAGE']['ADMIN_GENERAL_CONFIG'] . " :.</h3><br />\n";
if (isset($_POST['save']) && intval($_POST['save']) >= 1) {
    $KEYS = "";
    foreach ($apcms['POST'] as $key => $val) {
        if ($KEYS != "") {
            $KEYS .= ", ";
        }
        $KEYS .= "`" . apcms_ESC(apcms_Strip($key)) . "`='" . apcms_ESC(apcms_Strip($val)) . "'";
    }
    $UPDATE = "UPDATE `" . $apcms['table']['global']['config'] . "` SET " . $KEYS;
    $db->unbuffered_query($UPDATE);
    $success = $apcms['LANGUAGE']['SUCCESS_SAVED'];
    $apcms['redirect_url'] = $apcms['baseURL'] . "?c=admin";
    $apcms['redirect_time'] = 4;
    $retconf = $db->unbuffered_query_first("SELECT * FROM `" . $apcms['table']['global']['config'] . "`");
    $apcms['title'] = htmlspecialchars(stripslashes(trim($retconf[0])));
    $apcms['subtitle'] = htmlspecialchars(stripslashes(trim($retconf[1])));
    $apcms['description'] = htmlspecialchars(stripslashes(trim($retconf[2])));
    $apcms['sesslifetime'] = intval($retconf[3]);
    $apcms['emailfrom'] = stripslashes(trim($retconf[4]));
    $apcms['emailadress'] = stripslashes(trim($retconf[5]));
}
$AOUT .= "\n<div id=\"adminmain1\">\n";
$AOUT .= "\t\t\t<td>\n";
$AOUT .= "\t\t\t\t" . $apcms['LANGUAGE']['ADMIN_WELCOMEMSG1'] . "\n";
$AOUT .= "\t\t\t</td>\n";
$AOUT .= "\t\t</tr>\n";
$AOUT .= "\t</table>\n";
$AOUT .= "</div><br />\n";
$AOUT .= "\n<div id=\"adminmain1\">\n";
$AOUT .= "\t<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n";
$AOUT .= "\t\t<tr class=\"adminmain2\">\n";
$AOUT .= "\t\t\t<td colspan=\"2\">\n";
$AOUT .= "\t\t\t\t<b>" . $apcms['LANGUAGE']['ADMIN_SYSINFO'] . "</b>\n";
$AOUT .= "\t\t\t</td>\n";
$AOUT .= "\t\t</tr>\n";
$return = apcms_GetHTML('http://www.php-programs.de/versions_backend.php?what=apcms');
$available_version = ereg_replace(".*\\<version\\>([^\\<]+)\\<\\/version\\>.*", "\\1", apcms_Strip($return['html'], 1));
$available_version = apcms_Strip($available_version);
if (version_compare($apcms['version'], $available_version, "<")) {
    // update available!
    $class_local = "red";
    $class_official = "green";
} elseif (version_compare($apcms['version'], $available_version, ">")) {
    // local version is newer than official available version
    $class_local = "green";
    $class_official = "";
} else {
    // Local version is the most actual version
    $class_local = "green";
    $class_official = "green";
}
$AOUT .= "\t\t<tr class=\"adminmain2\">\n";
$AOUT .= "\t\t\t<td valign=\"top\">\n";
 function ReadNews($newsid)
 {
     /** globalising of the needed variables, objects and arrays */
     global $db, $apcms, $hook;
     $NOUT = '';
     $retnews = $db->unbuffered_query_first("SELECT * FROM `" . $this->newstable . "` WHERE `id`='" . intval($newsid) . "'");
     if (isset($retnews) && count($retnews) >= 1) {
         $postdate = intval($retnews[2]);
         $title = apcms_Strip($retnews[3]);
         if ($this->config['use_bbcode'] === true) {
             $body = apcms_TextOut(stripslashes($retnews[4]));
             $extbody = apcms_TextOut(stripslashes($retnews[5]));
         } else {
             $body = apcms_simpleTextOut(stripslashes($retnews[4]));
             $extbody = apcms_simpleTextOut(stripslashes($retnews[5]));
         }
         $views = intval($retnews[6]) + 1;
         $authorname = "";
         $db->unbuffered_query("UPDATE `" . $this->newstable . "` SET `views`='" . $views . "' WHERE `id`='" . intval($newsid) . "'");
         if ($this->config['show_author'] === true) {
             $retuser = $db->unbuffered_query_first("SELECT `nickname` FROM `" . $apcms['table']['global']['users'] . "` WHERE `id`='" . intval($retnews[1]) . "'");
             if (isset($retuser[0]) && trim($retuser[0]) != "") {
                 $authorname .= " @ " . apcms_Strip($retuser[0]);
             } else {
                 $authorname .= " @ " . $apcms['LANGUAGE']['GLOBAL_UNKNOWN'];
             }
         }
         $retcnum = $db->unbuffered_query_first("SELECT COUNT(*) FROM `" . $this->commentstable . "` WHERE `nid`='" . intval($newsid) . "'");
         $commentnum = intval($retcnum[0]);
         /** Include the Smarty class */
         require_once $apcms['path'] . "/libs/smarty.class.php";
         if ($this->config['use_bbcode'] === true) {
             $mainbox_head = apcms_Strip($retnews[3]);
             $mainbox_content = apcms_TextOut(stripslashes($retnews[4]));
             if (trim(stripslashes($retnews[5])) != "") {
                 $mainbox_content .= "\n<br />" . apcms_TextOut(stripslashes($retnews[5]));
             }
         } else {
             $mainbox_head = apcms_simpleTextOut($retnews[3]);
             $mainbox_content = apcms_simpleTextOut(stripslashes($retnews[4]));
             if (trim(stripslashes($retnews[5])) != "") {
                 $mainbox_content .= "\n<br />" . apcms_simpleTextOut(stripslashes($retnews[5]));
             }
         }
         $mainbox_foot = "<table class=\"apcms_mainboxfoot\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td class=\"apcms_mainboxfoot\">\n";
         $mainbox_foot .= date($this->config['dateformat'], intval($retnews[2])) . $authorname;
         $mainbox_foot .= "\n</td>\n<td width=\"50%\" class=\"apcms_mainboxfoot\" align=\"right\">\n";
         $mainbox_foot .= "[ " . intval($retnews[6]) . " " . $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['VIEWS'] . " | " . $commentnum . " <a href=\"" . $apcms['baseURL'] . "?news[action]=read&amp;news[id]=" . intval($retnews[0]) . "\">" . $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['COMMENTS'] . "</a> ]";
         $mainbox_foot .= "\n</td>\n</tr>\n</table>\n";
         $mbox = new APC_Smarty($apcms['themesdir'] . '/' . $apcms['theme']);
         $mbox->assign('mainbox_head', $mainbox_head);
         $mbox->assign('mainbox_content', $mainbox_content);
         $mbox->assign('mainbox_foot', $mainbox_foot);
         $mbout = $mbox->fetch('mainbox.tpl');
         $NOUT .= $mbout . "\n<a name=\"comments\"></a>\n\n<hr size=\"1\" noshade=\"noshade\" /><b><u>" . $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['COMMENTS'] . "</u></b>\n<br />\n<br />\n";
         /** Save the comment */
         if (isset($_POST['news']['action']) && trim($_POST['news']['action']) == "comment") {
             if (isset($_SESSION['isloggedin']) && intval($_SESSION['isloggedin']) >= 1) {
                 $_POST['news']['username'] = $_SESSION['nickname'];
                 $_POST['news']['email'] = $_SESSION['email'];
                 $uid = $_SESSION['userid'];
             } else {
                 $uid = 0;
             }
             if (!isset($_POST['news']['username']) || trim($_POST['news']['username']) == "") {
                 $error = $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['ERROR_NO_USERNAME'];
             } elseif (!isset($_POST['news']['email']) || trim($_POST['news']['email']) == "") {
                 $error = $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['ERROR_NO_EMAIL'];
             } elseif (!isset($_POST['news']['comment']) || trim($_POST['news']['comment']) == "") {
                 $error = $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['ERROR_NO_TEXT'];
             } else {
                 $query = "INSERT INTO `" . $this->commentstable . "` (`nid`, `uid`, `postdate`, `title`, `body`) VALUES (\n\t\t\t\t\t\t\t\t\t'" . intval($_POST['news']['nid']) . "', \n\t\t\t\t\t\t\t\t\t'" . intval($uid) . "', \n\t\t\t\t\t\t\t\t\t'" . time() . "', \n\t\t\t\t\t\t\t\t\t'" . apcms_ESC(apcms_Strip($_POST['news']['title'])) . "', \n\t\t\t\t\t\t\t\t\t'" . apcms_ESC(trim($_POST['news']['comment'])) . "' \n\t\t\t\t\t\t\t\t)";
                 $db->unbuffered_query($query);
                 $success = $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['SUCCESS_COMMENT_SAVED'];
             }
         }
         $retcomments = $db->unbuffered_GetAll_row("SELECT * FROM `" . $this->commentstable . "` WHERE `nid`='" . intval($newsid) . "' ORDER BY `postdate`");
         if (isset($retcomments) && count($retcomments) >= 1) {
             for ($a = 0; $a < count($retcomments); $a++) {
                 $mainbox_head = apcms_Strip($retcomments[$a][4]);
                 $mainbox_content = apcms_TextOut(stripslashes($retcomments[$a][5]));
                 $authorname = "";
                 if ($this->config['show_author'] === true) {
                     $retuser = $db->unbuffered_query_first("SELECT `nickname` FROM `" . $apcms['table']['global']['users'] . "` WHERE `id`='" . intval($retcomments[$a][2]) . "'");
                     if (isset($retuser[0]) && trim($retuser[0]) != "") {
                         $authorname .= " @ " . apcms_Strip($retuser[0]);
                     } else {
                         $authorname .= " @ " . $apcms['LANGUAGE']['GLOBAL_UNKNOWN'];
                     }
                 }
                 $mainbox_foot = "<table class=\"apcms_mainboxfoot\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td class=\"apcms_mainboxfoot\">\n";
                 $mainbox_foot .= date($this->config['dateformat'], intval($retcomments[$a][3])) . $authorname;
                 $mainbox_foot .= "\n</td>\n</tr>\n</table>\n";
                 $mbox = new APC_Smarty($apcms['themesdir'] . '/' . $apcms['theme']);
                 $mbox->assign('mainbox_head', $mainbox_head);
                 $mbox->assign('mainbox_content', $mainbox_content);
                 $mbox->assign('mainbox_foot', $mainbox_foot);
                 $mbout = $mbox->fetch('mainbox.tpl');
                 $NOUT .= $mbout . "\n\n<hr size=\"1\" noshade=\"noshade\" />";
             }
         } else {
             /** FIXME */
             /** maybe create something better looking...? */
             $NOUT .= "<br /><br /><div align=\"center\">" . $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['NO_COMMENTS'] . "</div>\n\n<hr size=\"1\" noshade=\"noshade\" />";
         }
         if (isset($error) && trim($error) != "") {
             $NOUT .= "<div id=\"error\">" . $error . "</div>";
             $error = "";
         }
         if (isset($success) && trim($success) != "") {
             $NOUT .= "<div id=\"success\">" . $success . "</div>";
             $success = "";
         }
         if (isset($_SESSION['isloggedin']) && intval($_SESSION['isloggedin']) >= 1 || $this->config['guest_comments'] === true) {
             $NOUT .= "\n<br />\n<div id=\"content1\">\n";
             $NOUT .= "<form name=\"commentform\" action=\"" . $apcms['baseURL'] . "?news[action]=read&amp;news[id]=" . intval($newsid) . "#comments\" method=\"post\">\n";
             $NOUT .= "<input type=\"hidden\" name=\"news[action]\" value=\"comment\" />\n";
             $NOUT .= "<input type=\"hidden\" name=\"news[nid]\" value=\"" . intval($newsid) . "\" />\n";
             $NOUT .= "\t<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n";
             if (isset($_SESSION['isloggedin']) && intval($_SESSION['isloggedin']) >= 1) {
                 $NOUT .= "\t\t<tr class=\"content2\">\n";
                 $NOUT .= "\t\t\t<td valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<label for=\"username\" accesskey=\"u\" tabindex=\"-1\">" . $apcms['LANGUAGE']['GLOBAL_USERNAME'] . "</label>\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t\t<td width=\"330\" align=\"right\" valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<input id=\"username\" type=\"text\" name=\"news[username]\" value=\"" . $_SESSION['nickname'] . "\" disabled=\"disabled\" readonly=\"readonly\" style=\"width:100%\" />\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t</tr>\n";
                 $NOUT .= "\t\t<tr class=\"content2\">\n";
                 $NOUT .= "\t\t\t<td valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<label for=\"email\" accesskey=\"e\" tabindex=\"-1\">" . $apcms['LANGUAGE']['GLOBAL_EMAIL'] . "</label>\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t\t<td width=\"330\" align=\"right\" valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<input id=\"email\" type=\"text\" name=\"news[email]\" value=\"" . $_SESSION['email'] . "\" disabled=\"disabled\" readonly=\"readonly\" style=\"width:100%\" />\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t</tr>\n";
             } else {
                 $NOUT .= "\t\t<tr class=\"content2\">\n";
                 $NOUT .= "\t\t\t<td valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<label for=\"username\" accesskey=\"u\" tabindex=\"1\">" . $apcms['LANGUAGE']['GLOBAL_USERNAME'] . "</label>\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t\t<td width=\"330\" align=\"right\" valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<input id=\"username\" type=\"text\" name=\"news[username]\" value=\"" . (isset($_POST['news']['username']) && trim($_POST['news']['username']) != "" ? apcms_Strip($_POST['news']['username']) : "") . "\" style=\"width:100%\" />\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t</tr>\n";
                 $NOUT .= "\t\t<tr class=\"content2\">\n";
                 $NOUT .= "\t\t\t<td valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<label for=\"email\" accesskey=\"e\" tabindex=\"2\">" . $apcms['LANGUAGE']['GLOBAL_EMAIL'] . "</label>\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t\t<td width=\"330\" align=\"right\" valign=\"top\">\n";
                 $NOUT .= "\t\t\t\t<input id=\"email\" type=\"text\" name=\"news[email]\" value=\"" . (isset($_POST['news']['email']) && trim($_POST['news']['email']) != "" ? apcms_Strip($_POST['news']['email']) : "") . "\" style=\"width:100%\" />\n";
                 $NOUT .= "\t\t\t</td>\n";
                 $NOUT .= "\t\t</tr>\n";
             }
             $NOUT .= "\t\t<tr class=\"content2\">\n";
             $NOUT .= "\t\t\t<td valign=\"top\">\n";
             $NOUT .= "\t\t\t\t<label for=\"title\" accesskey=\"t\" tabindex=\"3\">" . $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['COMMENT_TITLE'] . "</label>\n";
             $NOUT .= "\t\t\t</td>\n";
             $NOUT .= "\t\t\t<td width=\"330\" align=\"right\" valign=\"top\">\n";
             $NOUT .= "\t\t\t\t<input id=\"title\" type=\"text\" name=\"news[title]\" value=\"" . (isset($_POST['news']['title']) && trim($_POST['news']['title']) != "" ? apcms_Strip($_POST['news']['title']) : "") . "\" style=\"width:100%\" />\n";
             $NOUT .= "\t\t\t</td>\n";
             $NOUT .= "\t\t</tr>\n";
             $NOUT .= "\t\t<tr class=\"content2\">\n";
             $NOUT .= "\t\t\t<td valign=\"top\">\n";
             $NOUT .= "\t\t\t\t<label for=\"comment\" accesskey=\"c\" tabindex=\"4\">" . $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['COMMENT_BODY'] . "</label>\n";
             $NOUT .= "\t\t\t</td>\n";
             $NOUT .= "\t\t\t<td width=\"330\" align=\"right\" valign=\"top\">\n";
             $NOUT .= "\t\t\t\t<textarea id=\"comment\" name=\"news[comment]\" rows=\"6\" style=\"width:100%\">" . (isset($_POST['news']['comment']) && trim($_POST['news']['comment']) != "" ? trim($_POST['news']['comment']) : "") . "</textarea>\n";
             $NOUT .= "\t\t\t</td>\n";
             $NOUT .= "\t\t</tr>\n";
             $NOUT .= "\t\t<tr>\n";
             $NOUT .= "\t\t\t<td colspan=\"2\" align=\"center\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"submit\" accesskey=\"s\" tabindex=\"4\">\n\t\t\t\t\t\t\t\t\t\t\t<input id=\"submit\" onfocus=\"formInUse=true;\" type=\"submit\" name=\"news[submit]\" value=\"" . $apcms['LANGUAGE']['apcms_plugin_newsmanagement']['COMMENT_SAVE'] . "\" />\n\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t</td>\n";
             $NOUT .= "\t\t</tr>\n";
             $NOUT .= "\t</table>\n";
             $NOUT .= "</form>\n";
             $NOUT .= "</div><br />\n";
             $NOUT .= "\t<script type=\"text/javascript\">\n";
             if (isset($_SESSION['isloggedin']) && intval($_SESSION['isloggedin']) >= 1) {
                 $NOUT .= "\t\tdocument.getElementById('title').focus();\n";
             } else {
                 $NOUT .= "\t\tdocument.getElementById('username').focus();\n";
             }
             $NOUT .= "\t</script>\n";
         }
     } else {
     }
     /** Give the output to the Hook event of the mainpage (main.php) */
     $hook->Set_MainContent($NOUT);
 }
Beispiel #6
0
        @ob_flush();
        $fdir = opendir("./setup/sql");
        while ($sql = readdir($fdir)) {
            if (is_file("./setup/sql/" . $sql)) {
                include "./setup/sql/" . $sql;
                @ob_flush();
                usleep(100000);
                @ob_flush();
                @ob_flush();
            }
            @ob_flush();
        }
        closedir($fdir);
        @ob_flush();
        @ob_flush();
        usleep(100000);
        @ob_flush();
        $cpassword = apcms_CryptPasswd(trim($_SESSION['form']['admin_password']));
        echo " &nbsp;<span style=\"font-weight:bolder;color:green\">*</span> &nbsp;" . $apcms['LANGUAGE']['DEF_INSERTING_ADIMIN'] . "...<br />";
        $INSERT = "INSERT INTO `apcms_1_global_users` (\n\t\t\t\t\t\t`nickname`, \n\t\t\t\t\t\t`password`, \n\t\t\t\t\t\t`email`, \n\t\t\t\t\t\t`groups`, \n\t\t\t\t\t\t`theme`, \n\t\t\t\t\t\t`language`, \n\t\t\t\t\t\t`active`, \n\t\t\t\t\t\t`actkey`, \n\t\t\t\t\t\t`regdate`, \n\t\t\t\t\t\t`last_login`\n\t\t\t) VALUES (\n\t\t\t\t\t\t'" . apcms_ESC(apcms_Strip($_SESSION['form']['admin_username'])) . "', \n\t\t\t\t\t\t'" . $cpassword . "', \n\t\t\t\t\t\t'" . apcms_ESC(apcms_Strip($_SESSION['form']['admin_email'])) . "', \n\t\t\t\t\t\t'a:1:{i:0;i:1;}', \n\t\t\t\t\t\t'default', \n\t\t\t\t\t\t'" . $_SESSION['lang'] . "', \n\t\t\t\t\t\t1, \n\t\t\t\t\t\t'', \n\t\t\t\t\t\t'" . time() . "', \n\t\t\t\t\t\t0\n\t\t\t)";
        $db->unbuffered_query($INSERT);
        @ob_flush();
        usleep(100000);
        @ob_flush();
        @ob_flush();
    }
    @ob_flush();
    include "./setup/footer." . $SUFFIX;
    @ob_flush();
}
@ob_flush();
            if (!file_exists($PATH . "/plugins/" . $plugin_name . "/" . $plugin_name . "." . $SUFFIX)) {
                /** Plugin has to be installed directly from the server */
                $installicon = "<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=plugins&amp;install=" . $plugin_name . "&amp;local=0&amp;update=0\"><img src=\"" . $apcms['themesurl'] . "/images/admin/install.from.server.png\" width=\"66\" height=\"50\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_INSTALL'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_INSTALL'] . "\" /></a>";
            } else {
                /** Plugin already exists locally... */
                $plugin_version = apcms_Strip($plugobj[trim($plugin_name)]->version);
                if (version_compare($plugin_version, $vailable_version, "<")) {
                    /** Local plugin is older than the official one from the server and must be downloaded again */
                    $installicon = "<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=plugins&amp;install=" . $plugin_name . "&amp;local=0&amp;update=0\"><img src=\"" . $apcms['themesurl'] . "/images/admin/update.png\" width=\"66\" height=\"50\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_UPDATE'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_UPDATE'] . "\" /></a>";
                } elseif (version_compare($plugin_version, $vailable_version, "==")) {
                    /** Local Plugin is the same as the official one and can be installed from local */
                    $installicon = "<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=plugins&amp;install=" . $plugin_name . "&amp;local=1&amp;update=0\"><img src=\"" . $apcms['themesurl'] . "/images/admin/install.from.local.png\" width=\"66\" height=\"50\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_ALREADY_INSTALLED'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_ALREADY_INSTALLED'] . "\" /></a>";
                } else {
                    /** Local Plugin is newer than the official one and must be installed from local */
                    $installicon = "<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=plugins&amp;install=" . $plugin_name . "&amp;local=1&amp;update=0\"><img src=\"" . $apcms['themesurl'] . "/images/admin/install.from.local.png\" width=\"66\" height=\"50\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_ALREADY_INSTALLED'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_ALREADY_INSTALLED'] . "\" /></a>";
                }
            }
        }
        $AOUT .= "\t\t<tr>\n";
        $AOUT .= "\t\t\t<td>\n";
        $AOUT .= "\t\t\t\t<b>" . $plugin . "</b><br />\n";
        $AOUT .= "\t\t\t\t" . apcms_Strip($ALLPLUGINS['description'][$a]) . "<br />\n";
        $AOUT .= "\t\t\t\tVersion: <a href=\"" . apcms_Strip($ALLPLUGINS['homepage'][$a]) . "\">" . apcms_Strip($ALLPLUGINS['version'][$a]) . "</a>; Author: <a href=\"mailto:" . apcms_Strip($ALLPLUGINS['author_email'][$a]) . "\">" . apcms_Strip($ALLPLUGINS['author_name'][$a]) . "</a><br />\n";
        $AOUT .= "\t\t\t</td>\n";
        $AOUT .= "\t\t\t<td width=\"100\" align=\"center\">" . $installicon . "</td>\n";
        $AOUT .= "\t\t</tr>\n";
        $AOUT .= "\t\t<tr><td colspan=\"2\"><hr></td></tr>\n";
    }
}
$AOUT .= "\t</table>\n";
$AOUT .= "</form><br />\n";
    }
}
if (isset($retplugins) && count($retplugins) >= 1) {
    for ($a = 0; $a < count($retplugins); $a++) {
        if (is_array($plugin[$retplugins[$a][1]]['config']) && count($plugin[$retplugins[$a][1]]['config']) >= 1) {
            $ptitle = "<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=pluginconfigure&amp;id=" . intval($retplugins[$a][0]) . "\">" . apcms_Strip($apcms['PLUGIN'][$retplugins[$a][1]]->plugin) . "</a>";
            $configicon = "<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=pluginconfigure&amp;id=" . intval($retplugins[$a][0]) . "\"><img src=\"" . $apcms['themesurl'] . "/images/admin/config.png\" width=\"16\" height=\"16\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_CONFIGURE'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_CONFIGURE'] . "\" /></a>&nbsp;\n";
        } else {
            $ptitle = apcms_Strip($apcms['PLUGIN'][$retplugins[$a][1]]->plugin);
            $configicon = "\t\t\t\t<img src=\"" . $apcms['themesurl'] . "/images/blank.png\" width=\"16\" height=\"16\" alt=\"\" />&nbsp;\n";
        }
        $AOUT .= "\t\t<tr>\n";
        $AOUT .= "\t\t\t<td>\n";
        $AOUT .= "\t\t\t\t<b>" . $ptitle . "</b><br />\n";
        $AOUT .= "\t\t\t\t" . apcms_Strip($apcms['PLUGIN'][$retplugins[$a][1]]->description) . "<br />\n";
        $AOUT .= "\t\t\t\tVersion: <a href=\"" . apcms_Strip($apcms['PLUGIN'][$retplugins[$a][1]]->author_homepage) . "\">" . apcms_Strip($apcms['PLUGIN'][$retplugins[$a][1]]->version) . "</a>; Author: <a href=\"mailto:" . apcms_Strip($apcms['PLUGIN'][$retplugins[$a][1]]->author_email) . "\">" . apcms_Strip($apcms['PLUGIN'][$retplugins[$a][1]]->author_name) . "</a><br />\n";
        $AOUT .= "\t\t\t</td>\n";
        $AOUT .= "\t\t\t<td width=\"120\" align=\"right\">\n";
        $AOUT .= "\t\t\t\t\n" . $configicon . "\n";
        if (intval($retplugins[$a][3]) == 1) {
            $AOUT .= "\t\t\t\t<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=plugins&amp;deactivate=" . $retplugins[$a][1] . "\"><img src=\"" . $apcms['themesurl'] . "/images/admin/deactivate.png\" width=\"16\" height=\"16\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_DEACTIVATE'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_DEACTIVATE'] . "\" /></a>&nbsp;\n";
        } else {
            $AOUT .= "\t\t\t\t<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=plugins&amp;activate=" . $retplugins[$a][1] . "\"><img src=\"" . $apcms['themesurl'] . "/images/admin/activate.png\" width=\"16\" height=\"16\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_ACTIVATE'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_ACTIVATE'] . "\" /></a>&nbsp;\n";
        }
        $AOUT .= "\t\t\t\t<a href=\"" . $apcms['baseURL'] . "?c=admin&amp;act=plugins&amp;delete=" . $retplugins[$a][1] . "\"><img src=\"" . $apcms['themesurl'] . "/images/admin/delete.png\" width=\"16\" height=\"16\" alt=\"" . $apcms['LANGUAGE']['GLOBAL_DELETE'] . "\" title=\"" . $apcms['LANGUAGE']['GLOBAL_DELETE'] . "\" /></a>&nbsp;\n";
        $AOUT .= "\t\t\t\t\n";
        $AOUT .= "\t\t\t\t&nbsp; &nbsp;\n";
        $AOUT .= "\t\t\t</td>\n";
        $AOUT .= "\t\t</tr>\n";
        $AOUT .= "\t\t<tr><td colspan=\"2\"><hr></td></tr>\n";
    }
Beispiel #9
0
            ob_start();
            $oldlevel = error_reporting(0);
            eval($matches[4][$countthis]);
            error_reporting($oldlevel);
            $buffer = ob_get_contents();
            ob_end_clean();
            $navbox_content = str_replace($matches[0][$countthis], $buffer, $navbox_content);
        }
        unset($matches);
        preg_match_all("/(\\[box=)([^\\]]+)(\\])/siU", $navbox_content, $matches);
        for ($countthis = 0; $countthis < count($matches[0]); $countthis++) {
            $boxcontent = apcms_DisplayBoxContent($matches[2][$countthis]);
            $navbox_content = str_replace($matches[0][$countthis], $boxcontent, $navbox_content);
        }
        $lnav = new APC_Smarty($apcms['themesdir'] . '/' . $THEME);
        $lnav->assign('navbox_head', apcms_Strip($retright[$a][1]));
        $lnav->assign('navbox_content', $navbox_content);
        $lout = $lnav->fetch('navbox.tpl');
        $RightSideBar .= $lout;
    }
}
$smarty->assign('apcms_leftSideBar', $LeftSideBar);
$smarty->assign('apcms_rightSideBar', $RightSideBar);
$COUT = "";
if (!apcms_CheckAccess('global_access', $_SESSION['groups'])) {
    $error = $apcms['LANGUAGE']['ERROR_ACCESS_DENIED'];
    $apcms['redirect_url'] = $apcms['referer'];
    $apcms['redirect_time'] = 3;
} else {
    include $includefile;
}
Beispiel #10
0
             $c = "register";
             $include = "register";
             $includefile = $PATH . "/includes/register.inc.php";
         } else {
             $cpassword = apcms_CryptPasswd(trim($apcms['POST']['password1']));
             $actkey = apcms_GenRandomString(8);
             $INSERT = "INSERT INTO `" . $apcms['table']['global']['users'] . "` \n\t\t\t\t\t\t\t\t\t\t\t (\n\t\t\t\t\t\t\t\t\t\t\t\t`nickname`, \n\t\t\t\t\t\t\t\t\t\t\t\t`password`, \n\t\t\t\t\t\t\t\t\t\t\t\t`email`, \n\t\t\t\t\t\t\t\t\t\t\t\t`groups`, \n\t\t\t\t\t\t\t\t\t\t\t\t`actkey`,\n\t\t\t\t\t\t\t\t\t\t\t\t`regdate` \n\t\t\t\t\t\t\t\t\t) VALUES ( \n\t\t\t\t\t\t\t\t\t\t\t\t'" . apcms_ESC($apcms['POST']['username']) . "', \n\t\t\t\t\t\t\t\t\t\t\t\t'" . apcms_ESC($cpassword) . "', \n\t\t\t\t\t\t\t\t\t\t\t\t'" . apcms_ESC($apcms['POST']['email']) . "', \n\t\t\t\t\t\t\t\t\t\t\t\t'a:1:{i:0;i:3;}', \n\t\t\t\t\t\t\t\t\t\t\t\t'" . apcms_ESC($actkey) . "', \n\t\t\t\t\t\t\t\t\t\t\t\t'" . time() . "' \n\t\t\t\t\t\t\t\t\t) ";
             $db->unbuffered_query($INSERT);
             $fromname = apcms_Strip($apcms['emailfrom']);
             $frommail = apcms_Strip($apcms['emailadress']);
             $toname = apcms_Strip($apcms['POST']['username']);
             $tomail = apcms_Strip($apcms['POST']['email']);
             $subject = str_replace("{username}", apcms_Strip($apcms['POST']['username']), $apcms['LANGUAGE']['REGISTER_ACTMAIL_SUBJECT']);
             $subject = str_replace("{baseurl}", $apcms['baseURL'], $subject);
             $body = $apcms['LANGUAGE']['REGISTER_ACTMAIL_BODY'];
             $body = str_replace("{username}", apcms_Strip($apcms['POST']['username']), $body);
             $body = str_replace("{acturl}", $apcms['baseURL'] . "?c=activate&amp;key=" . $actkey, $body);
             $from = "{$fromname} <{$frommail}>";
             $to = "{$toname} <{$tomail}>";
             $headers = "From: {$from}\r\n";
             $headers .= "Reply-To: {$frommail}\r\n";
             $headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n\r\n";
             mail("{$to}", "{$subject}", "{$body}", "{$headers}");
             $apcms['redirect_url'] = $apcms['POST']['referer'];
             $apcms['redirect_time'] = 10;
             $success = $apcms['LANGUAGE']['SUCCESS_REGISTERED'];
             unset($_SESSION['regref']);
         }
     }
 }
 break;