Пример #1
0
function changemblock($title, $content)
{
    global $NPDS_Prefix;
    $title = stripslashes(FixQuotes($title));
    $content = stripslashes(FixQuotes($content));
    sql_query("UPDATE " . $NPDS_Prefix . "mainblock SET title='{$title}', content='{$content}'");
    global $aid;
    Ecr_Log("security", "ChangeMainBlock({$title}) by AID : {$aid}", "");
    Header("Location: admin.php?op=adminMain");
}
Пример #2
0
function Admin_alert($motif)
{
    global $admin;
    setcookie("admin", "", 0);
    unset($admin);
    Ecr_Log("security", "auth.inc.php/Admin_alert : " . $motif, "");
    $Titlesitename = "NPDS";
    if (file_exists("meta/meta.php")) {
        include "meta/meta.php";
    }
    echo "</head>\n<body style=\"background-color: #FFFFFF;\">\n<br /><br /><br />";
    echo "<p align=\"center\" style=\"font-size: 14px; font-family: Tahoma, Arial; color: Red;\"><b>.: " . translate("Your IP is recorded") . " :.</b></p>\n";
    echo "</body>\n";
    echo "</html>\n";
    die;
}
Пример #3
0
function Admin_alert($motif)
{
    global $admin;
    setcookie('admin', '', 0);
    unset($admin);
    Ecr_Log('security', 'auth.inc.php/Admin_alert : ' . $motif, '');
    $Titlesitename = 'NPDS';
    if (file_exists("meta/meta.php")) {
        include "meta/meta.php";
    }
    echo '
      </head>
      <body>
         <br /><br /><br />
         <p style="font-size: 24px; font-family: Tahoma, Arial; color: red; text-align:center;"><strong>.: ' . translate("Your IP is recorded") . ' :.</strong></p>
      </body>
   </html>';
    die;
}
Пример #4
0
function SendSite($yname, $ymail, $fname, $fmail, $asb_question, $asb_reponse)
{
    global $user;
    if (!$user) {
        //anti_spambot
        if (!R_spambot($asb_question, $asb_reponse, "")) {
            Ecr_Log('security', "Friend Anti-Spam : name=" . $yname . " / mail=" . $ymail, '');
            redirect_url("index.php");
            die;
        }
    }
    global $sitename, $nuke_url;
    $subject = translate("Interesting Site:") . " {$sitename}";
    $fname = removeHack($fname);
    $message = translate("Hello") . " {$fname} :\n\n" . translate("Your Friend") . " {$yname} " . translate("considered our site") . " {$sitename} " . translate("interesting and wanted to send it to you.") . "\n\n{$sitename} : <a href=\"{$nuke_url}\">{$nuke_url}</a>\n\n";
    include "signat.php";
    $fmail = removeHack($fmail);
    $subject = removeHack($subject);
    $message = removeHack($message);
    $yname = removeHack($yname);
    $ymail = removeHack($ymail);
    $stop = false;
    if (!$fmail || $fmail == '' || !preg_match('#^[_\\.0-9a-z-]+@[0-9a-z-\\.]+\\.+[a-z]{2,4}$#i', $fmail)) {
        $stop = true;
    }
    if (!$ymail || $ymail == '' || !preg_match('#^[_\\.0-9a-z-]+@[0-9a-z-\\.]+\\.+[a-z]{2,4}$#i', $ymail)) {
        $stop = true;
    }
    if (!$stop) {
        send_email($fmail, $subject, $message, $ymail, false, 'html');
    } else {
        $fname = '';
    }
    Header("Location: friend.php?op=SiteSent&fname={$fname}");
}
Пример #5
0
// Affichage
adminhead($f_meta_nom, $f_titre, $adminimg);
echo adm_translate("Optimisation effectuée ") . ' : ' . adm_translate("Gain total réalisé") . ' ' . $total_gain . ' Ko</br>';
echo $last_opti;
echo "<p>" . adm_translate("A ce jour, vous avez effectué ") . " " . $countopt . " optimisation(s) " . adm_translate(" et réalisé un gain global de ") . " " . $gainopt . " Ko.</p>\n";
echo '<table id="tad_opti" data-toggle="table" data-striped="true" data-show-toggle="true" data-mobile-responsive="true" data-icons="icons" data-icons-prefix="fa">
    <thead>
        <tr>
            <th data-sortable="true" align="center">' . adm_translate('Table') . '</th>
            <th align="center">' . adm_translate('Taille actuelle') . '</th>
            <th data-sortable="true" align="center">' . adm_translate('Etat') . '</th>
            <th align="center">' . adm_translate('Gain réalisable') . '</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td></td>
            <td></td>
            <td>' . adm_translate("Gain total réalisé") . ' : </td>
            <td>' . $total_gain . ' Ko</td>
        </tr>
    </tfoot>
    <tbody>' . "\n";
echo $li_tab_opti;
echo '
    </tbody>
    </table>';
adminfoot('', '', '', '');
global $aid;
Ecr_Log("security", "OptiMySql() by AID : {$aid}", "");
Пример #6
0
function Add($title, $url, $name, $cat, $description, $email, $topicL, $asb_question, $asb_reponse)
{
    global $ModPath, $ModStart, $links_DB, $troll_limit, $anonymous, $user, $admin;
    if (!$user and !$admin) {
        //anti_spambot
        if (!R_spambot($asb_question, $asb_reponse, "")) {
            Ecr_Log("security", "Links Anti-Spam : url=" . $url, "");
            redirect_url("index.php");
            die;
        }
    }
    $result = sql_query("SELECT lid FROM " . $links_DB . "links_newlink");
    $numrows = sql_num_rows($result);
    if ($numrows >= $troll_limit) {
        error_head("alert-danger");
        echo translate("ERROR: This URL is already listed in the Database!") . "<br />";
        error_foot();
        exit;
    }
    global $user;
    if (isset($user)) {
        global $cookie;
        $submitter = $cookie[1];
    } else {
        $submitter = $anonymous;
    }
    if ($title == '') {
        error_head("alert-danger");
        echo translate("ERROR: You need to type a TITLE for your URL!") . "<br />";
        error_foot();
        exit;
    }
    if ($email == '') {
        error_head("alert-danger");
        echo translate("ERROR: Invalid email") . "<br />";
        error_foot();
        exit;
    }
    global $links_url;
    if ($url == '' and $links_url == 1) {
        error_head("alert-danger");
        echo translate("ERROR: You need to type a URL for your URL!") . "<br />";
        error_foot();
        exit;
    }
    if ($description == '') {
        error_head("alert-danger");
        echo translate("ERROR: You need to type a DESCRIPTION for your URL!") . "<br />";
        error_foot();
        exit;
    }
    $cat = explode('-', $cat);
    if (!array_key_exists(1, $cat)) {
        $cat[1] = 0;
    }
    $title = removeHack(stripslashes(FixQuotes($title)));
    $url = removeHack(stripslashes(FixQuotes($url)));
    $description = removeHack(stripslashes(FixQuotes($description)));
    $name = removeHack(stripslashes(FixQuotes($name)));
    $email = removeHack(stripslashes(FixQuotes($email)));
    sql_query("INSERT INTO " . $links_DB . "links_newlink VALUES (NULL, '{$cat['0']}', '{$cat['1']}', '{$title}', '{$url}', '{$description}', '{$name}', '{$email}', '{$submitter}', '{$topicL}')");
    error_head("alert-success");
    echo translate("We received your Link submission. Thanks!") . "<br />";
    echo translate("You'll receive and E-mail when it's approved.") . "<br />";
    error_foot();
}
Пример #7
0
function submitStory($subject, $story, $bodytext, $topic, $date_debval, $date_finval, $epur, $asb_question, $asb_reponse)
{
    global $user, $EditedMessage, $anonymous, $notify, $NPDS_Prefix;
    if ($user) {
        global $cookie;
        $uid = $cookie[0];
        $name = $cookie[1];
    } else {
        $uid = -1;
        $name = $anonymous;
        //anti_spambot
        if (!R_spambot($asb_question, $asb_reponse, "")) {
            Ecr_Log("security", "Submit Anti-Spam : name=" . $yname . " / mail=" . $ymail, "");
            redirect_url("index.php");
            die;
        }
    }
    $subject = removeHack(stripslashes(FixQuotes(str_replace("\"", "&quot;", strip_tags($subject)))));
    $story = removeHack(stripslashes(FixQuotes($story)));
    $bodytext = removeHack(stripslashes(FixQuotes($bodytext)));
    $result = sql_query("INSERT INTO " . $NPDS_Prefix . "queue VALUES (NULL, '{$uid}', '{$name}', '{$subject}', '{$story}', '{$bodytext}', now(), '{$topic}','{$date_debval}','{$date_finval}','{$epur}')");
    if (sql_last_id()) {
        if ($notify) {
            global $notify_email, $notify_subject, $notify_message, $notify_from;
            send_email($notify_email, $notify_subject, $notify_message, $notify_from, false, "text");
        }
        include 'header.php';
        echo '<h2>' . translate("Submit News") . '</h2>';
        echo '<p class="lead text-info">' . translate("Thanks for your submission.") . '</p>';
        include 'footer.php';
    } else {
        include 'header.php';
        echo sql_error();
        include 'footer.php';
    }
}
Пример #8
0
function deleterblock($id)
{
    global $NPDS_Prefix;
    sql_query("DELETE FROM " . $NPDS_Prefix . "rblocks WHERE id='{$id}'");
    global $aid;
    Ecr_Log("security", "DeleteRightBlock({$id}) by AID : {$aid}", "");
    Header("Location: admin.php?op=blocks");
}
Пример #9
0
function updateadmin($chng_aid, $chng_name, $chng_email, $chng_url, $chng_radminfilem, $chng_radminsuper, $chng_pwd, $chng_pwd2, $temp_system_md5)
{
    global $NPDS_Prefix, $modu;
    if (!($chng_aid && $chng_name && $chng_email)) {
        Header("Location: admin.php?op=mod_authors");
    }
    // Gestion du fichier pour filemanager
    $result = sql_query("SELECT radminfilem,radminsuper FROM " . $NPDS_Prefix . "authors WHERE aid='{$chng_aid}'");
    list($ori_radminfilem, $ori_radminsuper) = sql_fetch_row($result);
    if ($ori_radminsuper and !$chng_radminsuper) {
        @unlink("modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if (!$ori_radminsuper and $chng_radminsuper) {
        @copy("modules/f-manager/users/modele.admin.conf.php", "modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if ($ori_radminfilem and !$chng_radminfilem) {
        @unlink("modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if (!$ori_radminfilem and $chng_radminfilem) {
        @copy("modules/f-manager/users/modele.admin.conf.php", "modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if ($chng_pwd2 != '') {
        if ($chng_pwd != $chng_pwd2) {
            global $hlpfile;
            include "header.php";
            GraphicAdmin($hlpfile);
            echo error_handler(adm_translate("Désolé, les nouveaux Mots de Passe ne correspondent pas. Cliquez sur retour et recommencez") . "<br />");
            include "footer.php";
            exit;
        }
        global $system_md5;
        if ($system_md5 or $temp_system_md5) {
            $chng_pwd = crypt($chng_pwd2, $chng_pwd);
        }
        if ($chng_radminsuper == 1) {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='0', radminsuper='{$chng_radminsuper}', pwd='{$chng_pwd}' WHERE aid='{$chng_aid}'");
        } else {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='{$chng_radminfilem}', radminsuper='0', pwd='{$chng_pwd}' WHERE aid='{$chng_aid}'");
        }
    } else {
        if ($chng_radminsuper == 1) {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='0', radminsuper='{$chng_radminsuper}' WHERE aid='{$chng_aid}'");
            deletedroits($chng_aid);
        } else {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='{$chng_radminfilem}', radminsuper='0' WHERE aid='{$chng_aid}'");
            deletedroits($chng_aid);
            updatedroits($chng_aid);
        }
    }
    global $aid;
    Ecr_Log('security', "ModifyAuthor({$chng_name}) by AID : {$aid}", '');
    Header("Location: admin.php?op=mod_authors");
}
Пример #10
0
function updateUser($chng_uid, $chng_uname, $chng_name, $chng_url, $chng_email, $chng_femail, $chng_user_from, $chng_user_occ, $chng_user_intrest, $chng_user_viewemail, $chng_avatar, $chng_user_sig, $chng_bio, $chng_pass, $chng_pass2, $level, $open_user, $chng_groupe, $chng_send_email, $chng_is_visible, $chng_mns, $C1, $C2, $C3, $C4, $C5, $C6, $C7, $C8, $M1, $M2, $T1, $T2, $B1, $raz_avatar, $chng_rank, $chng_lnl)
{
    global $NPDS_Prefix;
    $tmp = 0;
    if ($chng_pass2 != '') {
        if ($chng_pass != $chng_pass2) {
            global $hlpfile, $f_meta_nom, $f_titre, $adminimg;
            include "header.php";
            GraphicAdmin($hlpfile);
            adminhead($f_meta_nom, $f_titre, $adminimg);
            echo error_handler(adm_translate("Désolé, les nouveaux Mots de Passe ne correspondent pas. Cliquez sur retour et recommencez") . "<br />");
            adminfoot('', '', '', '');
            return;
        }
        $tmp = 1;
    }
    $result = sql_query("SELECT mns FROM " . $NPDS_Prefix . "users WHERE uid='{$chng_uid}'");
    list($tmp_mns) = sql_fetch_row($result);
    if ($tmp_mns == 0 and $chng_mns == 1) {
        Minisites($chng_mns, $chng_uname);
    }
    if ($chng_send_email == '') {
        $chng_send_email = '0';
    }
    if ($chng_is_visible == '') {
        $chng_is_visible = '1';
    } else {
        $chng_is_visible = '0';
    }
    if ($raz_avatar) {
        $chng_avatar = "blank.gif";
    }
    if ($tmp == 0) {
        sql_query("UPDATE " . $NPDS_Prefix . "users SET uname='{$chng_uname}', name='{$chng_name}', email='{$chng_email}', femail='{$chng_femail}', url='{$chng_url}', user_from='{$chng_user_from}', user_occ='{$chng_user_occ}', user_intrest='{$chng_user_intrest}', user_viewemail='{$chng_user_viewemail}', user_avatar='{$chng_avatar}', user_sig='{$chng_user_sig}', bio='{$chng_bio}', send_email='{$chng_send_email}', is_visible='{$chng_is_visible}', mns='{$chng_mns}', user_lnl='{$chng_lnl}' WHERE uid='{$chng_uid}'");
    }
    if ($tmp == 1) {
        global $system;
        if (!$system) {
            $cpass = crypt($chng_pass, $chng_pass);
        } else {
            $cpass = $chng_pass;
        }
        sql_query("UPDATE " . $NPDS_Prefix . "users SET uname='{$chng_uname}', name='{$chng_name}', email='{$chng_email}', femail='{$chng_femail}', url='{$chng_url}', user_from='{$chng_user_from}', user_occ='{$chng_user_occ}', user_intrest='{$chng_user_intrest}', user_viewemail='{$chng_user_viewemail}', user_avatar='{$chng_avatar}', user_sig='{$chng_user_sig}', bio='{$chng_bio}', send_email='{$chng_send_email}', is_visible='{$chng_is_visible}', mns='{$chng_mns}', pass='******', user_lnl='{$chng_lnl}' WHERE uid='{$chng_uid}'");
    }
    if ($chng_user_viewemail) {
        $attach = 1;
    } else {
        $attach = 0;
    }
    if ($open_user == '') {
        $open_user = 0;
    }
    if (preg_match('#[a-zA-Z_]#', $chng_groupe)) {
        $chng_groupe = '';
    }
    if ($chng_groupe != '') {
        $tab_groupe = explode(',', $chng_groupe);
        if ($tab_groupe) {
            foreach ($tab_groupe as $groupevalue) {
                if ($groupevalue == "0" and $groupevalue != '') {
                    $chng_groupe = '';
                }
                if ($groupevalue == "1") {
                    $chng_groupe = '';
                }
                if ($groupevalue > "127") {
                    $chng_groupe = '';
                }
            }
        }
    }
    sql_query("UPDATE " . $NPDS_Prefix . "users_status SET attachsig='{$attach}', level='{$level}', open='{$open_user}', groupe='{$chng_groupe}', rank='{$chng_rank}' WHERE uid='{$chng_uid}'");
    sql_query("UPDATE " . $NPDS_Prefix . "users_extend SET C1='{$C1}', C2='{$C2}', C3='{$C3}', C4='{$C4}', C5='{$C5}', C6='{$C6}', C7='{$C7}', C8='{$C8}', M1='{$M1}', M2='{$M2}', T1='{$T1}', T2='{$T2}', B1='{$B1}' WHERE uid='{$chng_uid}'");
    global $aid;
    Ecr_Log("security", "UpdateUser({$chng_uid}, {$chng_uname}) by AID : {$aid}", "");
    global $referer;
    if ($referer != "memberslist.php") {
        Header("Location: admin.php?op=mod_users");
    } else {
        Header("Location: memberslist.php");
    }
}
Пример #11
0
     include "header.php";
 }
 // Either valid user/pass, or valid session. continue with post.
 if ($stop != 1) {
     $poster_ip = getip();
     if ($dns_verif) {
         $hostname = @gethostbyaddr($poster_ip);
     } else {
         $hostname = $poster_ip;
     }
     // anti flood
     anti_flood($Mmod, $anti_flood, $poster_ip, $userdata, $gmt);
     //anti_spambot
     if (isset($asb_question) and isset($asb_reponse)) {
         if (!R_spambot($asb_question, $asb_reponse, $message)) {
             Ecr_Log("security", "Forum Anti-Spam : forum=" . $forum . " / topic=" . $topic, "");
             redirect_url("{$url_ret}");
             die;
         }
     }
     if ($formulaire != '') {
         include "modules/comments/comments_extender.php";
     }
     if ($allow_html == 0 || isset($html)) {
         $message = htmlspecialchars($message, ENT_COMPAT | ENT_HTML401, cur_charset);
     }
     if (isset($sig) && $userdata['uid'] != 1) {
         $message .= ' [addsig]';
     }
     $message = aff_code($message);
     $message = str_replace("\n", "<br />", $message);
Пример #12
0
         }
     } else {
         $Err = $auto[1];
     }
     break;
 case "pict-save":
     $auto = fma_filter("d", $att_name, $obj->Extension);
     if ($auto[0]) {
         $auto[3] = decrypt($browse);
         $fp = fopen($auto[3] . "/" . $auto[2] . "/pic-manager.txt", 'w');
         settype($maxthumb, "integer");
         fputs($fp, "Enable and customize pic-manager / to remove pic-manager : just remove pic-manager.txt\n");
         fputs($fp, $maxthumb . "\n");
         fputs($fp, $refresh . "\n");
         fclose($fp);
         Ecr_Log("security", "Pic-Manager", $log_dir . "/" . $auto[2] . " IP=>" . getip());
     } else {
         $Err = $auto[1];
     }
 case "searchfile":
     $resp = $obj->SearchFile($base, $filesearch);
     if ($resp) {
         $resp = explode("|", $resp);
         array_pop($resp);
         $cpt = 0;
         while ($fic_resp = each($resp)) {
             // on limite le retour au niveau immédiatement inférieur au rep courant
             $rep_niv1 = explode("/", str_replace($base, "", $fic_resp[1]));
             if (count($rep_niv1) < 4) {
                 $dir_search = basename(dirname($fic_resp[1]));
                 $fic_search = basename($fic_resp[1]);
Пример #13
0
function edito_mod_save($edito_type, $XeditoJ, $XeditoN, $aff_jours, $aff_jour, $aff_nuit)
{
    if ($aff_jours <= 0) {
        $aff_jours = "999";
    }
    if ($edito_type == 'G') {
        $fp = fopen("static/edito.txt", "w");
        fputs($fp, "[jour]" . str_replace("&quot;", "\"", stripslashes($XeditoJ)) . "[/jour][nuit]" . str_replace("&quot;", "\"", stripslashes($XeditoN)) . "[/nuit]");
        fputs($fp, "aff_jours=" . $aff_jours);
        fputs($fp, "&aff_jour=" . $aff_jour);
        fputs($fp, "&aff_nuit=" . $aff_nuit);
        fputs($fp, "&aff_date=" . time());
        fclose($fp);
    } elseif ($edito_type == 'M') {
        $fp = fopen("static/edito_membres.txt", "w");
        fputs($fp, "[jour]" . str_replace("&quot;", "\"", stripslashes($XeditoJ)) . "[/jour][nuit]" . str_replace("&quot;", "\"", stripslashes($XeditoN)) . "[/nuit]");
        fputs($fp, "aff_jours=" . $aff_jours);
        fputs($fp, "&aff_jour=" . $aff_jour);
        fputs($fp, "&aff_nuit=" . $aff_nuit);
        fputs($fp, "&aff_date=" . time());
        fclose($fp);
    }
    global $aid;
    Ecr_Log("security", "editoSave () by AID : {$aid}", "");
    redirect_url("admin.php?op=Edito");
}
Пример #14
0
        if ($pasfinA and $pasfinB) {
            $subject = decryptK(removeHack($Xsubject), $tmp['KEY']);
            $hometext = decryptK(removeHack($Xhometext), $tmp['KEY']);
            $bodytext = decryptK(removeHack($Xbodytext), $tmp['KEY']);
            $notes = decryptK(removeHack($Xnotes), $tmp['KEY']);
            $ihome = decryptK(removeHack($Xihome), $tmp['KEY']);
            $date_finval = decryptK(removeHack($Xdate_finval), $tmp['KEY']);
            $epur = decryptK(removeHack($Xepur), $tmp['KEY']);
            // autonews ou pas ?
            $date_debval = decryptK(removeHack($Xdate_debval), $tmp['KEY']);
            if ($date_debval == "") {
                $result = sql_query("insert into " . $NPDS_Prefix . "stories values (NULL, '{$catid}', '{$aid}', '{$subject}', now(), '{$hometext}', '{$bodytext}', '0', '0', '{$topicid}', '{$author}', '{$notes}', '{$ihome}', '0', '{$date_finval}','{$epur}')");
                Ecr_Log("security", "Cluster Paradise : insert_stories ({$subject} - {$date_finval}) by AID : {$aid}", "");
                // Réseaux sociaux
                if (file_exists('modules/npds_twi/npds_to_twi.php')) {
                    include 'modules/npds_twi/npds_to_twi.php';
                }
                if (file_exists('modules/npds_fbk/npds_to_fbk.php')) {
                    include 'modules/npds_twi/npds_to_fbk.php';
                }
                // Réseaux sociaux
            } else {
                $result = sql_query("insert into " . $NPDS_Prefix . "autonews values (NULL, '{$catid}', '{$aid}', '{$subject}', now(), '{$hometext}', '{$bodytext}', '{$topicid}', '{$author}', '{$notes}', '{$ihome}','{$date_debval}','{$date_finval}','{$epur}')");
                Ecr_Log("security", "Cluster Paradise : insert_autonews ({$subject} - {$date_debval} - {$date_finval}) by AID : {$aid}", "");
            }
            sql_query("update " . $NPDS_Prefix . "users set counter=counter+1 where uname='{$author}'");
            sql_query("update " . $NPDS_Prefix . "authors set counter=counter+1 where aid='{$aid}'");
        }
    }
}
echo "<script type=\"text/javascript\">\n     //<![CDATA[\n     self.close();\n     //]]>\n     </script>";
Пример #15
0
function sitemap_create($PAGES, $filename)
{
    $ibid = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    $ibid .= "<urlset\n";
    $ibid .= "xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n";
    $ibid .= "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n";
    $ibid .= "xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9\n http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n\n";
    if (array_key_exists('sitemap', $PAGES['article.php'])) {
        $ibid .= sitemaparticle($PAGES['article.php']['sitemap']);
    }
    if (array_key_exists('sitemap', $PAGES['forum.php'])) {
        $ibid .= sitemapforum($PAGES['forum.php']['sitemap']);
    }
    if (array_key_exists('sitemap', $PAGES['sections.php'])) {
        $ibid .= sitemaprub($PAGES['sections.php']['sitemap']);
    }
    if (array_key_exists('sitemap', $PAGES['download.php'])) {
        $ibid .= sitemapdown($PAGES['download.php']['sitemap']);
    }
    $ibid .= sitemapothers($PAGES);
    $ibid .= "</urlset>";
    $file = fopen($filename, "w");
    fwrite($file, $ibid);
    fclose($file);
    Ecr_Log("sitemap", "sitemap generated : " . date("H:i:s", time()), "");
}
Пример #16
0
function ForumGoDel($forum_id, $ok = 0)
{
    global $hlpfile;
    global $NPDS_Prefix;
    if ($ok == 1) {
        sql_query("DELETE FROM " . $NPDS_Prefix . "forumtopics WHERE forum_id='{$forum_id}'");
        sql_query("DELETE FROM " . $NPDS_Prefix . "forum_read WHERE forum_id='{$forum_id}'");
        control_efface_post("forum_npds", "", "", $forum_id);
        sql_query("DELETE FROM " . $NPDS_Prefix . "forums WHERE forum_id='{$forum_id}'");
        Q_Clean();
        global $aid;
        Ecr_Log("security", "DeleteForum({$forum_id}) by AID : {$aid}", "");
        Header("Location: admin.php?op=ForumAdmin");
    } else {
        include "header.php";
        GraphicAdmin($hlpfile);
        opentable();
        echo "<p align=\"center\" class=\"rouge\"><b>" . adm_translate("ATTENTION :  êtes-vous certain de vouloir effacer ce Forum et tous ses Sujets ?") . "</b><br /><br />";
    }
    echo "[ <a href=\"admin.php?op=ForumGoDel&amp;forum_id={$forum_id}&amp;ok=1\" class=\"rouge\">" . adm_translate("Oui") . "</a> | <a href=\"admin.php?op=ForumAdmin\" class=\"noir\">" . adm_translate("Non") . "</a> ]<br /><br />";
    closetable();
    include "footer.php";
}
Пример #17
0
$m->add_submit_value("ok");
$m->add_url("modules.php");
$m->add_field("ModStart", "", $ModStart, 'hidden', false);
$m->add_field("ModPath", "", $ModPath, 'hidden', false);
/************************************************/
include $sform_path . "contact/formulaire.php";
/************************************************/
// Manage the <form>
switch ($ok) {
    case 'Soumettre':
    case 'Submit':
        if (!$sformret) {
            $m->make_response();
            //anti_spambot
            if (!R_spambot($asb_question, $asb_reponse, $message)) {
                Ecr_Log("security", "Contact", "");
                $ok = "";
            } else {
                $message = $m->aff_response("class=\"ligna\"", "not_echo", "");
                global $notify_email;
                send_email($notify_email, "Contact site", aff_langue($message), "", "", "html");
                echo "<p class=\"lead text-xs-center\">" . aff_langue("[french]Votre demande est prise en compte. Nous y r&#xE9;pondrons au plus vite[/french][english]Your request is taken into account. We will answer it as fast as possible.[/english]") . "</p>";
                break;
            }
        } else {
            $ok = "";
        }
    default:
        echo aff_langue($m->print_form("class=\"ligna\""));
        break;
}
Пример #18
0
function send_email_to_user($username, $subject, $message, $all, $groupe, $expediteur)
{
    global $NPDS_Prefix, $f_meta_nom, $f_titre, $adminimg;
    if ($subject != '') {
        if ($expediteur == 1) {
            $emetteur = 1;
        } else {
            global $user;
            if ($user) {
                $userX = base64_decode($user);
                $userdata = explode(':', $userX);
                $emetteur = $userdata[0];
            } else {
                $emetteur = 1;
            }
        }
        if ($all) {
            $result = sql_query("SELECT uid, user_langue FROM " . $NPDS_Prefix . "users");
            while (list($to_userid, $user_langue) = sql_fetch_row($result)) {
                $tab_to_userid[] = $to_userid . ':' . $user_langue;
            }
        } else {
            if ($groupe) {
                $result = sql_query("SELECT s.uid, s.groupe, u.user_langue FROM " . $NPDS_Prefix . "users_status s, " . $NPDS_Prefix . "users u WHERE s.uid=u.uid AND s.groupe!='' ORDER BY s.uid ASC");
                while (list($to_userid, $groupeX, $user_langue) = sql_fetch_row($result)) {
                    $tab_groupe = explode(',', $groupeX);
                    if ($tab_groupe) {
                        foreach ($tab_groupe as $groupevalue) {
                            if ($groupevalue == $groupe) {
                                $tab_to_userid[] = $to_userid . ':' . $user_langue;
                            }
                        }
                    }
                }
            } else {
                $result = sql_query("SELECT uid, user_langue FROM " . $NPDS_Prefix . "users WHERE uname='{$username}'");
                while (list($to_userid, $user_langue) = sql_fetch_row($result)) {
                    $tab_to_userid[] = $to_userid . ':' . $user_langue;
                }
            }
        }
        if ($subject == '' or $message == '') {
            header("location: admin.php");
        }
        $message = str_replace('\\n', '<br />', $message);
        global $gmt;
        $time = date(translate("dateinternal"), time() + $gmt * 3600);
        $pasfin = false;
        $count = 0;
        include_once "language/lang-multi.php";
        while ($count < sizeof($tab_to_userid)) {
            $to_tmp = explode(':', $tab_to_userid[$count]);
            $to_userid = $to_tmp[0];
            if ($to_userid != '' and $to_userid != 1) {
                $sql = "INSERT INTO " . $NPDS_Prefix . "priv_msgs (msg_image, subject, FROM_userid, to_userid, msg_time, msg_text) ";
                $sql .= "VALUES ('{$image}', '{$subject}', '{$emetteur}', '{$to_userid}', '{$time}', '{$message}')";
                if ($resultX = sql_query($sql)) {
                    $pasfin = true;
                }
                // A copy in email if necessary
                global $nuke_url, $subscribe;
                if ($subscribe) {
                    $old_message = $message;
                    $sujet = translate_ml($to_tmp[1], 'Vous avez un nouveau message.');
                    $message = translate_ml($to_tmp[1], 'Bonjour') . ",<br /><br /><a href=\"{$nuke_url}/viewpmsg.php\">" . translate_ml($to_tmp[1], "Cliquez ici pour lire votre nouveau message.") . "</a><br /><br />";
                    include "signat.php";
                    copy_to_email($to_userid, $sujet, $message);
                    $message = $old_message;
                }
            }
            $count++;
        }
    }
    global $aid;
    Ecr_Log('security', "SendEmailToUser({$subject}) by AID : {$aid}", '');
    global $hlpfile;
    include 'header.php';
    GraphicAdmin($hlpfile);
    adminhead($f_meta_nom, $f_titre, $adminimg);
    echo '
   <hr />';
    if ($pasfin) {
        echo '
   <div class="alert alert-success"><strong>"' . stripslashes($subject) . '"</strong> ' . adm_translate("a été envoyée") . '.</div>';
    } else {
        echo '
   <div class="alert alert-danger"><strong>"' . stripslashes($subject) . '"</strong>' . adm_translate("n'a pas été envoyée") . '.</div>';
    }
    adminfoot('', '', '', '');
}
Пример #19
0
function updaterights($chng_aid, $maxindex, $creation, $publication, $modification, $suppression)
{
    global $NPDS_Prefix;
    global $radminsuper;
    if ($radminsuper != 1) {
        Header("Location: admin.php?op=sections");
    }
    $result = sql_query("DELETE FROM " . $NPDS_Prefix . "publisujet WHERE aid='{$chng_aid}'");
    for ($j = 1; $j < $maxindex + 1; $j++) {
        if ($creation[$j] != "") {
            $result = sql_query("INSERT INTO " . $NPDS_Prefix . "publisujet VALUES ('{$chng_aid}','{$creation[$j]}','1')");
        }
        if ($publication[$j] != "") {
            $result = sql_query("INSERT INTO " . $NPDS_Prefix . "publisujet VALUES ('{$chng_aid}','{$publication[$j]}','2')");
        }
        if ($modification[$j] != "") {
            $result = sql_query("INSERT INTO " . $NPDS_Prefix . "publisujet VALUES ('{$chng_aid}','{$modification[$j]}','3')");
        }
        if ($suppression[$j] != "") {
            $result = sql_query("INSERT INTO " . $NPDS_Prefix . "publisujet VALUES ('{$chng_aid}','{$suppression[$j]}','4')");
        }
    }
    global $aid;
    Ecr_Log("security", "UpdateRightsPubliSujet({$chng_aid}) by AID : {$aid}", "");
    Header("Location: admin.php?op=sections");
}
Пример #20
0
     $modo = user_is_moderator($userdata['uid'], $userdata['uname'], $forum_access);
     include 'header.php';
 }
 // Either valid user/pass, or valid session. continue with post.
 if ($stop != 1) {
     $poster_ip = getip();
     if ($dns_verif) {
         $hostname = @gethostbyaddr($poster_ip);
     } else {
         $hostname = '';
     }
     // anti flood
     anti_flood($modo, $anti_flood, $poster_ip, $userdata, $gmt);
     //anti_spambot
     if (!R_spambot($asb_question, $asb_reponse, $message)) {
         Ecr_Log("security", "Forum Anti-Spam : forum=" . $forum . " / topic_title=" . $subject, "");
         redirect_url("index.php");
         die;
     }
     if ($myrow['forum_type'] == 8) {
         $formulaire = $myrow['forum_pass'];
         include "modules/sform/forum/forum_extender.php";
     }
     if ($allow_html == 0 || isset($html)) {
         $message = htmlspecialchars($message, ENT_COMPAT | ENT_HTML401, cur_charset);
     }
     if (isset($sig) && $userdata['uid'] != 1 && $myrow['forum_type'] != 6 && $myrow['forum_type'] != 5) {
         $message .= " [addsig]";
     }
     if ($myrow['forum_type'] != 6 and $myrow['forum_type'] != 5) {
         $message = aff_code($message);
Пример #21
0
function ConfigFiles_create($modele)
{
    @umask("0000");
    if ($modele == "header_before") {
        @copy("modules/include/sample.header_before.inc", "modules/include/header_before.inc");
        @chmod("modules/include/header_before.inc", 0766);
    } elseif ($modele == "header_head") {
        @copy("modules/include/sample.header_head.inc", "modules/include/header_head.inc");
        @chmod("modules/include/header_head.inc", 0766);
    } elseif ($modele == "body_onload") {
        @copy("modules/include/sample.body_onload.inc", "modules/include/body_onload.inc");
        @chmod("modules/include/body_onload.inc", 0766);
    } elseif ($modele == "header_after") {
        @copy("modules/include/sample.header_after.inc", "modules/include/header_after.inc");
        @chmod("modules/include/header_after.inc", 0766);
    } elseif ($modele == "footer_before") {
        copy("modules/include/sample.footer_before.inc", "modules/include/footer_before.inc");
        chmod("modules/include/footer_before.inc", 0766);
    } elseif ($modele == "footer_after") {
        @copy("modules/include/sample.footer_after.inc", "modules/include/footer_after.inc");
        @chmod("modules/include/footer_after.inc", 0766);
    } elseif ($modele == "new_user") {
        @copy("modules/include/sample.new_user.inc", "modules/include/new_user.inc");
        @chmod("modules/include/new_user.inc", 0766);
    } elseif ($modele == "user") {
        @copy("modules/include/sample.user.inc", "modules/include/user.inc");
        @chmod("modules/include/user.inc", 0766);
    }
    global $aid;
    Ecr_Log('security', "CreateConfigFile({$modele}) by AID : {$aid}", '');
    header("location: admin.php?op=ConfigFiles");
}
Пример #22
0
            } else {
                include "header.php";
                $stop = translate("This account or IP has been temporarily disabled. This means that either this IP, or user account has been moderated down more than x times in the last few hours. If you think this is unfair, you should contact the admin.") . "<br />";
                error_handler($stop);
                include "footer.php";
            }
        } else {
            redirect_url("index.php");
        }
    } else {
        redirect_url("index.php");
    }
}
settype($op, 'string');
switch ($op) {
    case "subscribe":
        subscribe($email);
        break;
    case "subscribeOK":
        //anti_spambot
        if (!R_spambot($asb_question, $asb_reponse, "")) {
            Ecr_Log("security", "LNL Anti-Spam : email=" . $email, "");
            redirect_url("index.php");
            die;
        }
        subscribe_ok($email);
        break;
    case "unsubscribe":
        unsubscribe($email);
        break;
}
Пример #23
0
function changeStory($sid, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $members, $Mmembers, $Cdate, $Csid, $date_finval, $epur, $theme)
{
    global $NPDS_Prefix;
    global $aid, $ultramode;
    $subject = stripslashes(FixQuotes(str_replace('"', '&quot;', $subject)));
    $hometext = stripslashes(FixQuotes($hometext));
    $bodytext = stripslashes(FixQuotes($bodytext));
    $notes = stripslashes(FixQuotes($notes));
    if ($members == 1 and $Mmembers == "") {
        $ihome = "-127";
    }
    if ($members == 1 and ($Mmembers > 1 and $Mmembers <= 127)) {
        $ihome = $Mmembers;
    }
    if ($Cdate) {
        sql_query("UPDATE " . $NPDS_Prefix . "stories SET catid='{$catid}', title='{$subject}', hometext='{$hometext}', bodytext='{$bodytext}', topic='{$topic}', notes='{$notes}', ihome='{$ihome}',time=now(), date_finval='{$date_finval}', auto_epur='{$epur}', archive='0' WHERE sid='{$sid}'");
    } else {
        sql_query("UPDATE " . $NPDS_Prefix . "stories SET catid='{$catid}', title='{$subject}', hometext='{$hometext}', bodytext='{$bodytext}', topic='{$topic}', notes='{$notes}', ihome='{$ihome}', date_finval='{$date_finval}', auto_epur='{$epur}' WHERE sid='{$sid}'");
    }
    if ($Csid) {
        if ($ibid = theme_image("pick.gif")) {
            $imgtmp = $ibid;
        } else {
            $imgtmp = "images/pick.gif";
        }
        sql_query("UPDATE " . $NPDS_Prefix . "stories SET hometext='<img src=\"" . $imgtmp . "\" border=\"0\" align=\"center\" alt=\"\" /> :: {$hometext}' WHERE sid='{$sid}'");
        list($Lsid) = sql_fetch_row(sql_query("SELECT sid FROM " . $NPDS_Prefix . "stories ORDER BY sid DESC"));
        $Lsid++;
        sql_query("UPDATE " . $NPDS_Prefix . "stories SET sid='{$Lsid}' WHERE sid='{$sid}'");
        // commentaires
        if (file_exists("modules/comments/article.conf.php")) {
            include "modules/comments/article.conf.php";
            sql_query("UPDATE " . $NPDS_Prefix . "posts SET topic_id='{$Lsid}' WHERE forum_id='{$forum}' AND topic_id='{$topic}'");
        }
        $sid = $Lsid;
    }
    global $aid;
    Ecr_Log("security", "changeStory({$sid}, {$subject}, hometext..., bodytext..., {$topic}, notes..., {$catid}, {$ihome}, {$members}, {$Mmembers}, {$Cdate}, {$Csid}, {$date_finval},{$epur},{$theme}) by AID : {$aid}", "");
    if ($ultramode) {
        ultramode();
    }
    // Cluster Paradise
    if (file_exists("modules/cluster-paradise/cluster-activate.php")) {
        include "modules/cluster-paradise/cluster-activate.php";
    }
    if (file_exists("modules/cluster-paradise/cluster-M.php")) {
        include "modules/cluster-paradise/cluster-M.php";
    }
    // Cluster Paradise
    // Réseaux sociaux
    if (file_exists('modules/npds_twi/npds_to_twi.php')) {
        include 'modules/npds_twi/npds_to_twi.php';
    }
    if (file_exists('modules/npds_fbk/npds_to_fbk.php')) {
        include 'modules/npds_twi/npds_to_fbk.php';
    }
    // Réseaux sociaux
    redirect_url("admin.php?op=EditStory&sid={$sid}");
}
Пример #24
0
function send_review($date, $title, $text, $reviewer, $email, $score, $cover, $url, $url_title, $hits, $id, $asb_question, $asb_reponse)
{
    global $admin, $user, $NPDS_Prefix;
    include 'header.php';
    $date = reversedate($date);
    $title = stripslashes(FixQuotes(strip_tags($title)));
    $text = stripslashes(Fixquotes(urldecode(removeHack($text))));
    if (!$user and !$admin) {
        //anti_spambot
        if (!R_spambot($asb_question, $asb_reponse, $text)) {
            Ecr_Log('security', 'Review Anti-Spam : title=' . $title, '');
            redirect_url("index.php");
            die;
        }
    }
    echo '
   <h2>' . translate("Write a Review") . '</h2>
   <br /><p class="lead text-danger">' . translate("Thanks for submitting this review") . '';
    if ($id != 0) {
        echo " " . translate("modification") . "";
    } else {
        echo ", {$reviewer}";
    }
    echo '<br /><br />';
    if ($admin && $id == 0) {
        sql_query("INSERT INTO " . $NPDS_Prefix . "reviews VALUES (NULL, '{$date}', '{$title}', '{$text}', '{$reviewer}', '{$email}', '{$score}', '{$cover}', '{$url}', '{$url_title}', '1')");
        echo translate("It is now available in the reviews database.");
    } else {
        if ($admin && $id != 0) {
            sql_query("UPDATE " . $NPDS_Prefix . "reviews SET date='{$date}', title='{$title}', text='{$text}', reviewer='{$reviewer}', email='{$email}', score='{$score}', cover='{$cover}', url='{$url}', url_title='{$url_title}', hits='{$hits}' WHERE id='{$id}'");
            echo translate("It is now available in the reviews database.");
        } else {
            sql_query("INSERT INTO " . $NPDS_Prefix . "reviews_add VALUES (NULL, '{$date}', '{$title}', '{$text}', '{$reviewer}', '{$email}', '{$score}', '{$url}', '{$url_title}')");
            echo translate("The editors will look at your submission. It should be available soon!");
        }
    }
    echo '</p><a class="btn btn-default" role="button" href="reviews.php" title="' . translate("Back to Reviews Index") . '"><i class="fa fa-lg fa-undo"></i>
</a>';
    include "footer.php";
}
Пример #25
0
function anti_flood($modoX, $paramAFX, $poster_ipX, $userdataX, $gmtX)
{
    // anti_flood : nd de post dans les 90 puis 30 dernières minutes / les modérateurs echappent à cette règle
    // security.log est utilisée pour enregistrer les tentatives
    global $NPDS_Prefix;
    global $anonymous;
    if (!array_key_exists('uname', $userdataX)) {
        $compte = $anonymous;
    } else {
        $compte = $userdataX['uname'];
    }
    if (!$modoX and $paramAFX > 0) {
        $sql = "SELECT COUNT(poster_ip) AS total FROM " . $NPDS_Prefix . "posts WHERE post_time>'";
        if ($userdataX['uid'] != 1) {
            $sql2 = "' AND (poster_ip='{$poster_ipX}' OR poster_id='" . $userdataX['uid'] . "')";
        } else {
            $sql2 = "' AND poster_ip='{$poster_ipX}'";
        }
        $timebase = date("Y-m-d H:i", time() + $gmtX * 3600 - 5400);
        list($time90) = sql_fetch_row(sql_query($sql . $timebase . $sql2));
        if ($time90 > $paramAFX * 2) {
            Ecr_Log("security", "Forum Anti-Flood : " . $compte, "");
            forumerror(translate("You are not allowed to post in this forum"));
        } else {
            $timebase = date("Y-m-d H:i", time() + $gmtX * 3600 - 1800);
            list($time30) = sql_fetch_row(sql_query($sql . $timebase . $sql2));
            if ($time30 > $paramAFX) {
                Ecr_Log("security", "Forum Anti-Flood : " . $compte, "");
                forumerror(translate("You are not allowed to post in this forum"));
            }
        }
    }
}
Пример #26
0
function groupe_chat_delete($groupe_id)
{
    global $NPDS_Prefix;
    sql_query("UPDATE " . $NPDS_Prefix . "groupes SET groupe_chat = '0' WHERE groupe_id = '{$groupe_id}';");
    global $aid;
    Ecr_Log("security", "DesactivateChatWS({$groupe_id}) by AID : {$aid}", "");
}
Пример #27
0
     $userdata = get_userdata($userdata[1]);
     include "header.php";
 }
 // Either valid user/pass, or valid session. continue with post.
 if ($stop != 1) {
     $poster_ip = getip();
     if ($dns_verif) {
         $hostname = @gethostbyaddr($poster_ip);
     } else {
         $hostname = '';
     }
     // anti flood
     anti_flood($modo, $anti_flood, $poster_ip, $userdata, $gmt);
     //anti_spambot
     if (!R_spambot($asb_question, $asb_reponse, $message)) {
         Ecr_Log('security', 'Forum Anti-Spam : forum=' . $forum . ' / topic=' . $topic, '');
         redirect_url("index.php");
         die;
     }
     if ($allow_html == 0 || isset($html)) {
         $message = htmlspecialchars($message, ENT_COMPAT | ENT_HTML401, cur_charset);
     }
     if (isset($sig) && $userdata['uid'] != 1) {
         $message .= ' [addsig]';
     }
     if ($forum_type != '6' and $forum_type != '5') {
         $message = aff_code($message);
         $message = str_replace("\n", '<br />', $message);
     }
     if ($allow_bbcode == 1 and $forum_type != '6' and $forum_type != '5') {
         $message = smile($message);
Пример #28
0
function LinksAddLink($new, $lid, $title, $url, $cat, $xtext, $name, $email, $submitter)
{
    global $NPDS_Prefix;
    $result = sql_query("SELECT url FROM " . $NPDS_Prefix . "links_links WHERE url='{$url}'");
    $numrows = sql_num_rows($result);
    if ($numrows > 0) {
        message_error("<span class=\"rouge\"><b>" . adm_translate("Erreur : cette URL est déjà présente dans la base de données !") . "</b></span>");
    } else {
        if ($title == '') {
            message_error("<span class=\"rouge\"><b>" . adm_translate("Erreur : vous devez saisir un TITRE pour votre Lien !") . "</b></span>");
        }
        if ($url == '') {
            message_error("<span class=\"rouge\"><b>" . adm_translate("Erreur : vous devez saisir une URL pour votre Lien !") . "</b></span>");
        }
        if ($xtext == '') {
            message_error("<span class=\"rouge\"><b>" . adm_translate("Erreur : vous devez saisir une DESCRIPTION pour votre Lien !") . "</b></span>");
        }
        $cat = explode('-', $cat);
        if (!array_key_exists(1, $cat)) {
            $cat[1] = 0;
        }
        $title = stripslashes(FixQuotes($title));
        $url = stripslashes(FixQuotes($url));
        $xtext = stripslashes(FixQuotes($xtext));
        $name = stripslashes(FixQuotes($name));
        $email = stripslashes(FixQuotes($email));
        sql_query("INSERT INTO " . $NPDS_Prefix . "links_links VALUES (NULL, '{$cat['0']}', '{$cat['1']}', '{$title}', '{$url}', '{$xtext}', now(), '{$name}', '{$email}', '0','{$submitter}',0,0,0,'')");
        if ($new == 1) {
            sql_query("DELETE FROM " . $NPDS_Prefix . "links_newlink WHERE lid='{$lid}'");
            if ($email != '') {
                global $sitename, $nuke_url;
                $subject = adm_translate("Votre Lien") . " : {$sitename}";
                $message = adm_translate("Bonjour") . " {$name} :\n\n" . adm_translate("Nous avons approuvé votre contribution à notre moteur de recherche.") . "\n\n" . adm_translate("Titre de la Page : ") . "{$title}\n" . adm_translate("URL de la Page : ") . "<a href=\"{$url}\">{$url}</a>\n" . adm_translate("Description : ") . "{$xtext}\n" . adm_translate("Vous pouvez utiliser notre moteur de recherche sur : ") . " <a href=\"{$nuke_url}/modules.php?ModPath=links&ModStart=links\">{$nuke_url}/modules.php?ModPath=links&ModStart=links</a>\n\n" . adm_translate("Merci pour votre Contribution !") . "\n";
                include "signat.php";
                send_email($email, $subject, $message, "", false, "html");
            }
        }
        global $aid;
        Ecr_Log("security", "AddLinks({$title}) by AID : {$aid}", "");
        message_error("<span class=\"noir\"><b>" . adm_translate("Nouveau Lien ajouté dans la base de données") . "</b></span>");
    }
}
Пример #29
0
function ConfigSave($xparse, $xsitename, $xnuke_url, $xsite_logo, $xslogan, $xstartdate, $xadminmail, $xtop, $xstoryhome, $xoldnum, $xultramode, $xanonpost, $xDefault_Theme, $xbanners, $xmyIP, $xfoot1, $xfoot2, $xfoot3, $xfoot4, $xbackend_title, $xbackend_language, $xbackend_image, $xbackend_width, $xbackend_height, $xlanguage, $xlocale, $xperpage, $xpopular, $xnewlinks, $xtoplinks, $xlinksresults, $xlinks_anonaddlinklock, $xnotify, $xnotify_email, $xnotify_subject, $xnotify_message, $xnotify_from, $xmoderate, $xanonymous, $xmaxOptions, $xsetCookies, $xtipath, $xuserimg, $xadminimg, $xadmingraphic, $xsite_font, $xadmart, $xminpass, $xhttpref, $xhttprefmax, $xpollcomm, $xlinkmainlogo, $xstart_page, $xsmilies, $xOnCatNewLink, $xEmailFooter, $xshort_user, $xgzhandler, $xrss_host_verif, $xcache_verif, $xmember_list, $xdownload_cat, $xmod_admin_news, $xgmt, $xAutoRegUser, $xTitlesitename, $xfilemanager, $xshort_review, $xnot_admin_count, $xadmin_cook_duration, $xuser_cook_duration, $xtroll_limit, $xsubscribe, $xCloseRegUser, $xshort_menu_admin, $xmail_fonction, $xmemberpass, $xshow_user, $xdns_verif, $xmember_invisible, $xavatar_size, $xlever, $xcoucher, $xmulti_langue, $xadmf_ext, $xsavemysql_size, $xsavemysql_mode, $xtiny_mce, $xnpds_twi, $xnpds_fcb)
{
    include "config.php";
    if ($xparse == 0) {
        $xsitename = FixQuotes($xsitename);
        $xTitlesitename = FixQuotes($xTitlesitename);
    } else {
        $xsitename = stripslashes($xsitename);
        $xTitlesitename = stripslashes($xTitlesitename);
    }
    $xnuke_url = FixQuotes($xnuke_url);
    $xsite_logo = FixQuotes($xsite_logo);
    if ($xparse == 0) {
        $xslogan = FixQuotes($xslogan);
        $xstartdate = FixQuotes($xstartdate);
    } else {
        $xslogan = stripslashes($xslogan);
        $xstartdate = stripslashes($xstartdate);
    }
    // Theme
    $xDefault_Theme = FixQuotes($xDefault_Theme);
    if ($xDefault_Theme != $Default_Theme) {
        include "cache.config.php";
        $dh = opendir($CACHE_CONFIG['data_dir']);
        while (false !== ($filename = readdir($dh))) {
            if ($filename === '.' or $filename === '..' or $filename === 'ultramode.txt' or $filename === 'net2zone.txt' or $filename === 'sql') {
                continue;
            }
            unlink($CACHE_CONFIG['data_dir'] . $filename);
        }
    }
    $xmyIP = FixQuotes($xmyIP);
    $xfoot1 = str_replace(chr(13) . chr(10), "\n", $xfoot1);
    $xfoot2 = str_replace(chr(13) . chr(10), "\n", $xfoot2);
    $xfoot3 = str_replace(chr(13) . chr(10), "\n", $xfoot3);
    $xfoot4 = str_replace(chr(13) . chr(10), "\n", $xfoot4);
    if ($xparse == 0) {
        $xbackend_title = FixQuotes($xbackend_title);
    } else {
        $xbackend_title = stripslashes($xbackend_title);
    }
    $xbackend_language = FixQuotes($xbackend_language);
    $xbackend_image = FixQuotes($xbackend_image);
    $xbackend_width = FixQuotes($xbackend_width);
    $xbackend_height = FixQuotes($xbackend_height);
    $xlanguage = FixQuotes($xlanguage);
    $xlocale = FixQuotes($xlocale);
    $xnotify_email = FixQuotes($xnotify_email);
    if ($xparse == 0) {
        $xnotify_subject = FixQuotes($xnotify_subject);
        $xdownload_cat = FixQuotes($xdownload_cat);
    } else {
        $xnotify_subject = stripslashes($xnotify_subject);
        $xdownload_cat = stripslashes($xdownload_cat);
    }
    $xnotify_message = str_replace(chr(13) . chr(10), "\n", $xnotify_message);
    $xnotify_from = FixQuotes($xnotify_from);
    $xanonymous = FixQuotes($xanonymous);
    $xtipath = FixQuotes($xtipath);
    $xuserimg = FixQuotes($xuserimg);
    $xadminimg = FixQuotes($xadminimg);
    $xsite_font = FixQuotes($xsite_font);
    $file = fopen("config.php", "w");
    $line = "######################################################################\n";
    $content = "<?php\n";
    $content .= "{$line}";
    $content .= "# DUNE by NPDS : Net Portal Dynamic System\n";
    $content .= "# ===================================================\n";
    $content .= "#\n";
    $content .= "# This version name NPDS Copyright (c) 2001-2015 by Philippe Brunier\n";
    $content .= "#\n";
    $content .= "# This module is to configure the main options for your site\n";
    $content .= "#\n";
    $content .= "# This program is free software. You can redistribute it and/or modify\n";
    $content .= "# it under the terms of the GNU General Public License as published by\n";
    $content .= "# the Free Software Foundation; either version 2 of the License.\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# ========================\n";
    $content .= "# Database & System Config\n";
    $content .= "# ========================\n";
    $content .= "# dbhost:      MySQL Database Hostname\n";
    $content .= "# dbuname:     MySQL Username\n";
    $content .= "# dbpass:      MySQL Password\n";
    $content .= "# dbname:      MySQL Database Name\n";
    $content .= "# mysql_p:     Persistent connection to MySQL Server (1) or Not (0)\n";
    $content .= "# mysql_i:     Use MySQLi (1) instead of MySQL interface (0)\n";
    $content .= "# =======================\n";
    $content .= "# system:      0 for Unix/Linux, 1 for Windows\n";
    $content .= "# system_md5:  0 for NOT USED Authors' Password encryption / 1 for USED Author's Password Encryption\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$dbhost = \"{$dbhost}\";\n";
    $content .= "\$dbuname = \"{$dbuname}\";\n";
    $content .= "\$dbpass = \"{$dbpass}\";\n";
    $content .= "\$dbname = \"{$dbname}\";\n";
    if (!isset($mysql_p)) {
        $mysql_p = 1;
    }
    $content .= "\$mysql_p = {$mysql_p};\n";
    if (!isset($mysql_i)) {
        $mysql_i = 0;
    }
    $content .= "\$mysql_i = {$mysql_i};\n";
    $content .= "# =======================\n";
    $content .= "\$system = {$system};\n";
    if (!$system_md5) {
        $system_md5 = 0;
    }
    $content .= "\$system_md5 = {$system_md5};\n";
    $content .= "\n";
    $content .= "/*********************************************************************/\n";
    $content .= "/* You finished to configure the Database. Now you can change all    */\n";
    $content .= "/* you want in the Administration Section.   To enter just launch    */\n";
    $content .= "/* you web browser pointing to http://yourdomain.com/admin.php       */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* At the prompt use the following ID to login (case sensitive):     */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* AdminID: Root                                                     */\n";
    $content .= "/* Password: Password                                                */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/* Be sure to change inmediately the Root login & password clicking  */\n";
    $content .= "/* on Edit Admin in the Admin menu. After that, click on Preferences */\n";
    $content .= "/* to configure your new site. In that menu you can change all you   */\n";
    $content .= "/* need to change.                                                   */\n";
    $content .= "/*                                                                   */\n";
    $content .= "/*********************************************************************/\n";
    $content .= "\n\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# General Site Configuration\n";
    $content .= "#\n";
    $content .= "# \$parse:          Select the parse function you want to use for preference\n";
    $content .= "# \$gzhandler:      PHP > 5.x : default 0 / PHP < 5.x sending compressed html with zlib : 1 - be careful\n";
    $content .= "# \$admin_cook_duration : Duration in hour for Admin cookie (default 24)\n";
    $content .= "# \$user_cook_duration: Duration in hour for Admin cookie (default 24)\n";
    $content .= "# \$sitename:       Your Site Name\n";
    $content .= "# \$Titlesitename:  Your Site Phrase for the Title (html Title Tag) off the HTML Page\n";
    $content .= "# \$nuke_url:       Complete URL for your site (Do not put / at end)\n";
    $content .= "# \$site_logo:      Logo for Printer Friendly Page (It's good to have a Black/White graphic)\n";
    $content .= "# \$slogan:         Your site's slogan\n";
    $content .= "# \$startdate:      Start Date to display in Statistic Page\n";
    $content .= "# \$moderate:       Moderation of comments\n";
    $content .= "# \$anonpost:       Allow Anonymous to Post Comments? (1=Yes 0=No)\n";
    $content .= "# \$troll_limit:    Maximum Number off Comments per user (24H)\n";
    $content .= "# \$mod_admin_news  Allow only Moderator and Admin to Post News? (1=Yes 0=No)\n";
    $content .= "# \$not_admin_count Don't record Admin's Hits in stats (1=Yes=>don't rec 0=No=>rec)\n";
    $content .= "# \$Default_Theme:  Default Theme for your site (See /themes directory for the complete list, case sensitive!)\n";
    $content .= "# \$Start_Page:     Default Page for your site (default : index.php but you can use : topics.php, links.php ...)\n";
    $content .= "# \$foot(x):        Messages for all footer pages (Can include HTML code)\n";
    $content .= "# \$anonymous:      Anonymous users Default Name\n";
    $content .= "# \$site_font:      Font for your entire site (Comma separated for many fonts type)\n";
    $content .= "# \$minpass:        Minimum character for users passwords\n";
    $content .= "# \$show_user:      Number off user showed in memberslist page\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$parse = \"{$xparse}\";\n";
    $content .= "\$gzhandler = \"{$xgzhandler}\";\n";
    $content .= "\$admin_cook_duration = \"{$xadmin_cook_duration}\";\n";
    $content .= "\$user_cook_duration = \"{$xuser_cook_duration}\";\n";
    $content .= "\$sitename = \"{$xsitename}\";\n";
    $content .= "\$Titlesitename = \"{$xTitlesitename}\";\n";
    $content .= "\$nuke_url = \"{$xnuke_url}\";\n";
    $content .= "\$site_logo = \"{$xsite_logo}\";\n";
    $content .= "\$slogan = \"{$xslogan}\";\n";
    $content .= "\$startdate = \"{$xstartdate}\";\n";
    $content .= "\$anonpost = {$xanonpost};\n";
    if (!$xtroll_limit) {
        $xtroll_limit = 6;
    }
    $content .= "\$troll_limit = {$xtroll_limit};\n";
    $content .= "\$moderate = {$xmoderate};\n";
    $content .= "\$mod_admin_news = {$xmod_admin_news};\n";
    $content .= "\$not_admin_count = {$xnot_admin_count};\n";
    $content .= "\$Default_Theme = \"{$xDefault_Theme}\";\n";
    $content .= "\$Start_Page = \"{$xstart_page}\";\n";
    $content .= "\$foot1 = \"{$xfoot1}\";\n";
    $content .= "\$foot2 = \"{$xfoot2}\";\n";
    $content .= "\$foot3 = \"{$xfoot3}\";\n";
    $content .= "\$foot4 = \"{$xfoot4}\";\n";
    $content .= "\$anonymous = \"{$xanonymous}\";\n";
    $content .= "\$site_font = \"{$xsite_font}\";\n";
    $content .= "\$minpass = {$xminpass};\n";
    $content .= "\$show_user = {$xshow_user};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# General Stories Options\n";
    $content .= "#\n";
    $content .= "# \$top:       How many items in Top Page?\n";
    $content .= "# \$storyhome: How many stories to display in Home Page?\n";
    $content .= "# \$oldnum:    How many stories in Old Articles Box?\n";
    $content .= "{$line}";
    $content .= "\n";
    if (!$xtop) {
        $xtop = 10;
    }
    $content .= "\$top = {$xtop};\n";
    if (!$xstoryhome) {
        $xstoryhome = 10;
    }
    $content .= "\$storyhome = {$xstoryhome};\n";
    if (!$xoldnum) {
        $xoldnum = 10;
    }
    $content .= "\$oldnum = {$xoldnum};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Banners/Advertising Configuration\n";
    $content .= "#\n";
    $content .= "# \$banners: Activate Banners Ads for your site? (1=Yes 0=No)\n";
    $content .= "# \$myIP:    Write your IP number to not count impressions, be fair about this!\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$banners = {$xbanners};\n";
    $content .= "\$myIP = \"{$xmyIP}\";\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# XML/RDF Backend Configuration & Social Networks\n";
    $content .= "#\n";
    $content .= "# \$backend_title:    Backend title, can be your site's name and slogan\n";
    $content .= "# \$backend_language: Language format of your site\n";
    $content .= "# \$backend_image:    Image logo for your site\n";
    $content .= "# \$backend_width:    Image logo width\n";
    $content .= "# \$backend_height:   Image logo height\n";
    $content .= "# \$ultramode:        Activate ultramode plain text and XML files backend syndication? (1=Yes 0=No). locate in /cache directory\n";
    $content .= "# \$npds_twi:         Activate the Twitter syndication? (1=Yes 0=No).\n";
    $content .= "# \$npds_fcb:         Activate the Facebook syndication? (1=Yes 0=No).\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$backend_title = \"{$xbackend_title}\";\n";
    $content .= "\$backend_language = \"{$xbackend_language}\";\n";
    $content .= "\$backend_image = \"{$xbackend_image}\";\n";
    $content .= "\$backend_width = \"{$xbackend_width}\";\n";
    $content .= "\$backend_height = \"{$xbackend_height}\";\n";
    $content .= "\$ultramode = {$xultramode};\n";
    if (!$xnpds_twi) {
        $xnpds_twi = 0;
    }
    $content .= "\$npds_twi = {$xnpds_twi};\n";
    if (!$xnpds_fcb) {
        $xnpds_fcb = 0;
    }
    $content .= "\$npds_fcb = {$xnpds_fcb};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Site Language Preferences\n";
    $content .= "#\n";
    $content .= "# \$language:     Language of your site (You need to have lang-xxxxxx.php file for your selected language in the /language directory of your site)\n";
    $content .= "# \$locale:       Locale configuration to correctly display date with your country format. (See /usr/share/locale)\n";
    $content .= "# \$gmt:          Locale configuration to correctly display date with your GMT offset.\n";
    $content .= "# \$lever:        HH:MM where Day become.\n";
    $content .= "# \$coucher:      HH:MM where Night become.\n";
    $content .= "# \$multi_langue: Activate Multi-langue NPDS'capability.\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$language = \"{$xlanguage}\";\n";
    $content .= "\$multi_langue = {$xmulti_langue};\n";
    $content .= "\$locale = \"{$xlocale}\";\n";
    $content .= "\$gmt = \"{$xgmt}\";\n";
    $content .= "\$lever = \"{$xlever}\";\n";
    $content .= "\$coucher = \"{$xcoucher}\";\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Web Links Preferences\n";
    $content .= "#\n";
    $content .= "# \$perpage:                  How many links to show on each page?\n";
    $content .= "# \$popular:                  How many hits need a link to be listed as popular?\n";
    $content .= "# \$newlinks:                 How many links to display in the New Links Page?\n";
    $content .= "# \$toplinks:                 How many links to display in The Best Links Page? (Most Popular)\n";
    $content .= "# \$linksresults:             How many links to display on each search result page?\n";
    $content .= "# \$links_anonaddlinklock:    Is Anonymous autorise to post new links? (0=Yes 1=No)\n";
    $content .= "# \$linkmainlogo:             Activate Logo on Main web Links Page (1=Yes 0=No)\n";
    $content .= "# \$OnCatNewLink:             Activate Icon for New Categorie on Main web Links Page (1=Yes 0=No)\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$perpage = {$xperpage};\n";
    $content .= "\$popular = {$xpopular};\n";
    $content .= "\$newlinks = {$xnewlinks};\n";
    $content .= "\$toplinks = {$xtoplinks};\n";
    $content .= "\$linksresults = {$xlinksresults};\n";
    $content .= "\$links_anonaddlinklock = {$xlinks_anonaddlinklock};\n";
    $content .= "\$linkmainlogo = {$xlinkmainlogo};\n";
    $content .= "\$OnCatNewLink = {$xOnCatNewLink};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Function Mail and Notification of News Submissions\n";
    $content .= "#\n";
    $content .= "# \$adminmail:      Site Administrator's Email\n";
    $content .= "# \$mail_fonction:  What Mail function to be used (1=mail, 2=email)\n";
    $content .= "# \$notify:         Notify you each time your site receives a news submission? (1=Yes 0=No)\n";
    $content .= "# \$notify_email:   Email, address to send the notification\n";
    $content .= "# \$notify_subject: Email subject\n";
    $content .= "# \$notify_message: Email body, message\n";
    $content .= "# \$notify_from:    account name to appear in From field of the Email\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$adminmail = \"{$xadminmail}\";\n";
    $content .= "\$mail_fonction = \"{$xmail_fonction}\";\n";
    $content .= "\$notify = {$xnotify};\n";
    $content .= "\$notify_email = \"{$xnotify_email}\";\n";
    $content .= "\$notify_subject = \"{$xnotify_subject}\";\n";
    $content .= "\$notify_message = \"{$xnotify_message}\";\n";
    $content .= "\$notify_from = \"{$xnotify_from}\";\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Survey/Polls Config\n";
    $content .= "#\n";
    $content .= "# \$maxOptions: Number of maximum options for each poll\n";
    $content .= "# \$setCookies: Set cookies to prevent visitors vote twice in a period of 24 hours? (0=Yes 1=No)\n";
    $content .= "# \$pollcomm:   Activate comments in Polls? (1=Yes 0=No)\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$maxOptions = {$xmaxOptions};\n";
    $content .= "\$setCookies = {$xsetCookies};\n";
    $content .= "\$pollcomm = {$xpollcomm};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Some Graphics Options\n";
    $content .= "#\n";
    $content .= "# \$tipath:       Topics images path (put / only at the end, not at the begining)\n";
    $content .= "# \$userimg:      User images path (put / only at the end, not at the begining)\n";
    $content .= "# \$adminimg:     Administration system images path (put / only at the end, not at the begining)\n";
    $content .= "# \$admingraphic: Activate graphic menu for Administration Menu? (1=Yes 0=No)\n";
    $content .= "# \$short_menu_admin: Activate short Administration Menu? (1=Yes 0=No)\n";
    $content .= "# \$admf_ext:     Image Files'extesion for admin menu (default: gif)\n";
    $content .= "# \$admart:       How many articles to show in the admin section?\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$tipath = \"{$xtipath}\";\n";
    $content .= "\$userimg = \"{$xuserimg}\";\n";
    $content .= "\$adminimg = \"{$xadminimg}\";\n";
    $content .= "\$short_menu_admin = {$xshort_menu_admin};\n";
    $content .= "\$admingraphic = {$xadmingraphic};\n";
    if (!$xadmf_ext) {
        $xadmf_ext = "gif";
    }
    $content .= "\$admf_ext = \"{$xadmf_ext}\";\n";
    $content .= "\$admart = {$xadmart};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# HTTP Referers Options\n";
    $content .= "#\n";
    $content .= "# \$httpref:    Activate HTTP referer logs to know who is linking to our site? (1=Yes 0=No)";
    $content .= "# \$httprefmax: Maximum number of HTTP referers to store in the Database (Try to not set this to a high number, 500 ~ 1000 is Ok)\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$httpref = {$xhttpref};\n";
    $content .= "\$httprefmax = {$xhttprefmax};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Miscelaneous Options\n";
    $content .= "#\n";
    $content .= "# \$smilies:          Activate Avatar? (1=Yes 0=No)\n";
    $content .= "# \$avatar_size:      Maximum size for uploaded avatars in pixel (width*height) \n";
    $content .= "# \$short_user:       Activate Short User registration (without ICQ, MSN, ...)? (1=Yes 0=No)\n";
    $content .= "# \$member_list:      Make the members List Private (only for members) or Public (Private=Yes Public=No)\n";
    $content .= "# \$download_cat:     Witch category do you want to show first in download section?\n";
    $content .= "# \$AutoRegUser:      Allow automated new-user creation (sending email and allowed connection)\n";
    $content .= "# \$short_review:     For transform reviews like \"gold book\" (1=Yes, 0=no)\n";
    $content .= "# \$subscribe:        Allow your members to subscribe to topics, ... (1=Yes, 0=no)\n";
    $content .= "# \$member_invisible: Allow members to hide from other members, ... (1=Yes, 0=no)\n";
    $content .= "# \$CloseRegUser:     Allow you to close New Member Registration (from Gawax Idea), ... (1=Yes, 0=no)\n";
    $content .= "# \$memberpass:       Allow user to choose alone the password (1=Yes, 0=no)\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$smilies = {$xsmilies};\n";
    $content .= "\$avatar_size = \"{$xavatar_size}\";\n";
    $content .= "\$short_user = {$xshort_user};\n";
    $content .= "\$member_list = {$xmember_list};\n";
    $content .= "\$download_cat = \"{$xdownload_cat}\";\n";
    $content .= "\$AutoRegUser = {$xAutoRegUser};\n";
    $content .= "\$short_review = {$xshort_review};\n";
    $content .= "\$subscribe = {$xsubscribe};\n";
    $content .= "\$member_invisible = {$xmember_invisible};\n";
    $content .= "\$CloseRegUser = {$xCloseRegUser};\n";
    $content .= "\$memberpass = {$xmemberpass};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# HTTP Miscelaneous Options\n";
    $content .= "#\n";
    $content .= "# \$rss_host_verif: Activate the validation of the existance of a web on Port 80 for Headlines (true=Yes false=No)\n";
    $content .= "# \$cache_verif:    Activate the Advance Caching Meta Tag (pragma ...) (true=Yes false=No)\n";
    $content .= "# \$dns_verif:      Activate the DNS resolution for posts (forum ...), IP-Ban, ... (true=Yes false=No)\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$rss_host_verif = {$xrss_host_verif};\n";
    $content .= "\$cache_verif = {$xcache_verif};\n";
    $content .= "\$dns_verif = {$xdns_verif};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# SYSTEM Miscelaneous Options\n";
    $content .= "#\n";
    $content .= "# \$savemysql_size:  Determine the maximum size for one file in the SaveMysql process\n";
    $content .= "# \$savemysql_mode:  Type of Myql process (1, 2 or 3)\n";
    $content .= "# \$tiny_mce:        true=Yes or false=No to use tiny_mce Editor or standard Npds Editor\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$savemysql_size = {$xsavemysql_size};\n";
    $content .= "\$savemysql_mode = {$xsavemysql_mode};\n";
    $content .= "\$tiny_mce = {$xtiny_mce};\n";
    $content .= "\n";
    $content .= "{$line}";
    $content .= "# Do not touch the following options !\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$NPDS_Prefix = \"{$NPDS_Prefix}\";\n";
    if ($NPDS_Key == "") {
        $NPDS_Key = uniqid("");
    }
    $content .= "\$NPDS_Key = \"{$NPDS_Key}\";\n";
    $content .= "\$Version_Num = \"16\";\n";
    $content .= "\$Version_Id = \"NPDS\";\n";
    $content .= "\$Version_Sub = \"REvolution\";\n";
    $content .= "\n";
    $content .= "?>";
    fwrite($file, $content);
    fclose($file);
    $file = fopen("filemanager.conf", "w");
    $content = "<?php\n";
    $content .= "# ========================================\n";
    $content .= "# DUNE by NPDS : Net Portal Dynamic System\n";
    $content .= "# ========================================\n";
    $content .= "\$filemanager= {$xfilemanager};\n";
    $content .= "?>";
    fwrite($file, $content);
    fclose($file);
    $xEmailFooter = str_replace(chr(13) . chr(10), "\n", $xEmailFooter);
    $file = fopen("signat.php", "w");
    $content = "<?php\n";
    $content .= "{$line}";
    $content .= "# DUNE by NPDS : Net Portal Dynamic System\n";
    $content .= "# ===================================================\n";
    $content .= "#\n";
    $content .= "# This version name NPDS Copyright (c) 2001-2015 by Philippe Brunier\n";
    $content .= "#\n";
    $content .= "# This module is to configure Footer of Email send By NPDS\n";
    $content .= "#\n";
    $content .= "# This program is free software. You can redistribute it and/or modify\n";
    $content .= "# it under the terms of the GNU General Public License as published by\n";
    $content .= "# the Free Software Foundation; either version 2 of the License.\n";
    $content .= "{$line}";
    $content .= "\n";
    $content .= "\$message .= \"{$xEmailFooter}\";\n";
    $content .= "?>";
    fwrite($file, $content);
    fclose($file);
    global $aid;
    Ecr_Log("security", "ConfigSave() by AID : {$aid}", "");
    SC_Clean();
    Header("Location: admin.php?op=AdminMain");
}
Пример #30
0
function update_password($code, $passwd)
{
    global $system;
    global $NPDS_Prefix;
    $ibid = explode("#fpwd#", $code);
    $uname = urlencode(decrypt($ibid[0]));
    $result = sql_query("SELECT email,pass FROM " . $NPDS_Prefix . "users WHERE uname='{$uname}'");
    list($email, $pass) = sql_fetch_row($result);
    if ($email != "") {
        $ibid = explode("#fpwd#", decryptK($ibid[1], $pass));
        if ($email == $ibid[0]) {
            // Le lien doit avoir ÈtÈ gÈnÈrÈ dans les 24H00
            if (time() - $ibid[2] < 86400) {
                // le mot de passe est-il identique
                if ($ibid[1] == $passwd) {
                    if (!$system) {
                        $cryptpass = crypt($ibid[1], $ibid[1]);
                    } else {
                        $cryptpass = $ibid[1];
                    }
                    sql_query("UPDATE " . $NPDS_Prefix . "users SET pass='******' WHERE uname='{$uname}'");
                    message_pass("<p class=\"lead text-xs-center\"><i class=\"fa fa-exclamation\"></i>&nbsp;" . translate("Password update, please re-connect you.") . "</p>");
                    Ecr_Log("security", "Lost_password_update OK : " . $uname, "");
                } else {
                    message_pass(translate("Error"));
                    Ecr_Log("security", "Lost_password_update Password not match : " . $uname, "");
                }
            } else {
                message_pass(translate("Error"));
                Ecr_Log("security", "Lost_password_update NOK Time > 24H00 : " . $uname, "");
            }
        } else {
            message_pass(translate("Error"));
            Ecr_Log("security", "Lost_password_update NOK Mail not match : " . $uname, "");
        }
    } else {
        message_pass(translate("Error"));
        Ecr_Log("security", "Lost_password_update NOK Empty Mail or bad user : "******"");
    }
}