示例#1
0
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceLines_Session", "auth" => "SourceLines_Auth", "perm" => "SourceLines_Perm"));
require "./include/header.inc";
$bx = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
$bi = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
$be = new box("", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_error_font_color, $th_box_body_align);
?>

<!-- content -->
<?php 
###
### Submit Handler
###
## Get a database connection
$db = new DB_SourceLines();
// Check if there was a submission
while (is_array($HTTP_POST_VARS) && (list($key, $val) = each($HTTP_POST_VARS))) {
    switch ($key) {
        case "u_edit":
            // Change user parameters
            if ($auth->auth["uid"] == $u_id) {
                // user changes his own account
                $password = trim($password);
                $cpassword = trim($cpassword);
                $realname = trim($realname);
                $email_usr = trim($email_usr);
                if (strcmp($password, $cpassword)) {
                    // password are identical?
                    $be->box_full($t->translate("Error"), $t->translate("The passwords are not identical") . ". " . $t->translate("Please try again") . "!");
                    break;
示例#2
0
require "./include/config.inc";
require "./include/lib.inc";
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
echo "           \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n";
echo "<rss version=\"0.91\">\n";
echo "  <channel>\n";
echo "    <title>" . htmlspecialchars($sys_name) . "</title>\n";
echo "    <link>http:" . $sys_url . "</link>\n";
echo "    <description>" . htmlspecialchars($sys_name . " - " . $sys_title) . "</description>\n";
echo "    <language>en-us</language>\n";
echo "  <image>\n";
echo "    <title>" . htmlspecialchars($sys_name) . "</title>\n";
echo "    <url>" . $sys_url . $sys_logo_image . "</url>\n";
echo "    <link>http:" . $sys_url . "</link>\n";
echo "    <description>" . htmlspecialchars($sys_name . " - " . $sys_title) . "</description>\n";
echo "    <width>66</width>\n";
echo "    <height>73</height>\n";
echo "  </image>\n";
$db = new DB_SourceLines();
$db->query("SELECT * FROM tblsolutions,auth_user WHERE tblsolutions.username = auth_user.username AND tblsolutions.solutions_name != 'no_name' ORDER BY tblsolutions.solutions_modify_date DESC limit 10");
$i = 0;
while ($db->next_record()) {
    echo "  <item>\n";
    echo "    <title>" . htmlspecialchars($db->f("solutions_name")) . "</title>\n";
    echo "    <link>http:" . $sys_url . "solutions.php?solu_id=" . $db->f("solutions_id") . "</link>\n";
    echo "  </item>\n";
    $i++;
}
echo "  </channel>\n";
echo "</rss>\n";
    }
    if (empty($conby)) {
        $conby = "Unknown";
    }
    $bx->box_title($t->translate("Contact") . ": " . $conby);
    $bx->box_body_begin();
    ?>
<table border=0 align=center cellspacing=1 cellpadding=1 width=100%>
<?php 
    echo "<tr><td><b>" . $t->translate("No") . ".</b></td><td><b>#&nbsp;" . $t->translate("Sols") . "</b></td><td><b>" . $t->translate("Name") . "</b></td><td><b>" . $t->translate("E-Mail") . "</b></td><td><b>" . $t->translate("Homepage") . "</b></td></tr>\n";
    $i = 1;
    while ($db->next_record()) {
        $solutions_contact_name = addslashes($db->f("solutions_contact_name"));
        $solutions_contact_email = $db->f("solutions_contact_email");
        $solutions_contact_url = $db->f("solutions_contact_url");
        $db2 = new DB_SourceLines();
        $db2->query("SELECT COUNT(*) FROM tblsolutions WHERE solutions_contact_name='{$solutions_contact_name}' AND solutions_contact_email='{$solutions_contact_email}' AND solutions_contact_url='{$solutions_contact_url}'");
        $db2->next_record();
        if ($db2->f("COUNT(*)")) {
            $num = "[" . sprintf("%03d", $db2->f("COUNT(*)")) . "]";
            echo "<tr><td>" . sprintf("%d", $i) . "</td>\n";
            if (empty($solutions_contact_name)) {
                echo "<td><a href=\"" . $sess->url("bycontact.php") . $sess->add_query(array("solutions_contact_name" => "", "solutions_contact_email" => "{$solutions_contact_email}", "solutions_contact_url" => "{$solutions_contact_url}")) . "\">{$num}</a></td>\n";
                echo "<td>" . $t->translate("Unknown") . "</td>\n";
            } else {
                echo "<td><a href=\"" . $sess->url("bycontact.php") . $sess->add_query(array("solutions_contact_name" => $db->f("solutions_contact_name"), "solutions_contact_email" => "{$solutions_contact_email}", "solutions_contact_url" => "{$solutions_contact_url}")) . "\">{$num}</a></td>\n";
                echo "<td>" . $db->f("solutions_contact_name") . "</td>\n";
            }
            if (!empty($solutions_contact_email)) {
                echo "<td>&lt;<a href=\"mailto:" . mailtoencode($solutions_contact_email) . "\">" . ereg_replace("\\.", " dot ", ereg_replace("@", " at ", htmlentities($solutions_contact_email))) . "</a>&gt;</td>\n";
            } else {
示例#4
0
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceLines_Session", "auth" => "SourceLines_Auth", "perm" => "SourceLines_Perm"));
}
require "./include/header.inc";
$bx = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
$be = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_error_font_color, $th_box_body_align);
?>

<!-- content -->
<?php 
###
### Submit Handler
###
## Get a database connection
$db = new DB_SourceLines();
// Check if there was a submission
$reg = 0;
while (is_array($HTTP_POST_VARS) && (list($key, $val) = each($HTTP_POST_VARS))) {
    switch ($key) {
        case "register":
            // Register a new user
            $username = trim($username);
            $password = trim($password);
            $cpassword = trim($cpassword);
            $realname = trim($realname);
            $email_usr = trim($email_usr);
            if (empty($username) || empty($password) || empty($cpassword) || empty($email_usr)) {
                // Do we have all necessary data?
                $be->box_full($t->translate("Error"), $t->translate("Please enter") . " <b>" . $t->translate("Username") . "</b>, <b>" . $t->translate("Password") . "</b> " . $t->translate("and") . " <b>" . $t->translate("E-Mail") . "</b>!");
                break;
    echo "<input type='submit' value='" . $t->translate("Back") . "'>";
    echo "</td></form></tr>";
    $tbw->table_body_column_end();
    $tbw->table_row_end();
    echo "</form>";
    /*----------*/
    $tbw->table_end();
    /*-----------------------------------------------------------------------*/
    $bx->box_body_end();
    $bx->box_end();
} else {
    if ($action == "delete") {
        // DELETE
        $id = rawurldecode($id);
        $solu_id = rawurldecode($solu_id);
        $db_del = new DB_SourceLines();
        $query = "SELECT * FROM tblkeyword WHERE keyword_id = '{$id}' AND solutions_id = '{$solu_id}'";
        $db_del->query($query);
        $db_del->next_record();
        /*-----------------------------------------------------------------------*/
        $bx->box_begin();
        $bx->box_title($t->translate("Delete keyword"));
        $bx->box_body_begin();
        /*-----------------------------------------------------------------------*/
        echo "<form action='" . $sess->url(basename($PHP_SELF)) . "' method='POST'>";
        $tbw->table_begin();
        // keyword
        $tbw->table_row_begin();
        $tbw->table_body_column_begin();
        echo "<b>" . $t->translate("Keyword") . ":</b>";
        $tbw->table_body_column_next(2);
示例#6
0
    while (list(, $ltr) = each($alphabet)) {
        $msg .= "<a href=\"" . $sess->url(basename($PHP_SELF)) . $sess->add_query(array("by" => $ltr . "%")) . "\">{$ltr}</a> | ";
    }
    $msg .= "<a href=\"" . $sess->url(basename($PHP_SELF)) . $sess->add_query(array("by" => "%")) . "\">" . $t->translate("All") . "</a> ]";
    $bs->box_strip($msg);
    $db->query("SELECT * FROM auth_user WHERE username LIKE '{$by}' ORDER BY username ASC");
    $bx->box_begin();
    $bx->box_title($t->translate("Users"));
    $bx->box_body_begin();
    echo "<table border=0 align=center cellspacing=1 cellpadding=1 width=100%>\n";
    echo "<tr><td><b>" . $t->translate("No") . ".</b></td><td><b>#&nbsp;" . $t->translate("Sols") . "</b></td><td><b>" . $t->translate("Username") . "</b></td><td><b>" . $t->translate("Realname") . "</b></td><td><b>" . $t->translate("E-Mail") . "</b></td></tr>\n";
    $i = 1;
    while ($db->next_record()) {
        $user_id = $db->f("user_id");
        $username = $db->f("username");
        $db2 = new DB_SourceLines();
        $db2->query("SELECT COUNT(*) FROM tblsolutions WHERE username='******' AND solutions_name != 'no_name'");
        $db2->next_record();
        $num = "[" . sprintf("%03d", $db2->f("COUNT(*)")) . "]";
        echo "<tr><td>" . sprintf("%d", $i) . "</td>\n";
        echo "<td><a href=\"" . $sess->url("yoursolutions.php") . $sess->add_query(array("user" => $username)) . "\">{$num}</a></td>\n";
        echo "<td>" . $username . "</td>\n";
        echo "<td>" . $db->f("realname") . "</td>";
        echo "<td>&lt;<a href=\"mailto:" . mailtoencode($db->f("email_usr")) . "\">" . ereg_replace("\\.", " dot ", ereg_replace("@", " at ", htmlentities($db->f("email_usr")))) . "</a>&gt;</td>";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
    $bx->box_body_end();
    $bx->box_end();
}
示例#7
0
<!-- content -->
<?php 
if ($perm->have_perm("user_pending")) {
    $be->box_full($t->translate("Error"), $t->translate("Access denied"));
} else {
    if (isset($id)) {
        $query = "SELECT * FROM tblsolutions WHERE solutions_id='{$id}'";
        $db->query($query);
        $db->next_record();
        // If solution in table ask for comment
        $db_status = $db->f("status");
        if ($db->num_rows() > 0) {
            if ($action == "cmt") {
                $query = "INSERT tblcomment SET solutions_id='{$id}',comment_subject='{$subject}',comment_text='{$text}',comment_username='******',comment_datetime='" . date("Y-m-d H:i:s") . "'";
                $db_cmt = new DB_SourceLines();
                $db_cmt->query($query);
                solfull($db);
            } else {
                $bx->box_begin();
                $bx->box_title($t->translate("Your Comment about") . " \"" . $db->f("solutions_name") . "\"");
                $bx->box_body_begin();
                echo "<form action=\"" . $sess->url(basename($PHP_SELF)) . "\" method=\"POST\">\n";
                echo "<table border=0 align=center cellspacing=0 cellpadding=3>\n";
                echo "<tr><td align=right>" . $t->translate("Subject") . " (128):</td><td><input type=\"TEXT\" name=\"subject\" size=40 maxlength=128></td></tr>\n";
                echo "<tr><td align=right>" . $t->translate("Comment") . " (*):</td><td><textarea cols=40 rows=7 name=\"text\" wrap=\"virtual\" maxlength=255></textarea></td></tr>\n";
                echo "<tr><td align=right>&nbsp;</td><td><input type=\"Submit\" value=\"" . $t->translate("Send") . "\"></td>\n";
                echo "<input type=\"hidden\" name=\"action\" value=\"cmt\">\n";
                echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n";
                echo "</form>\n";
                echo "</tr></table>\n";
    echo "<input type='submit' value='" . $t->translate("Back") . "'>";
    echo "</td></form></tr>";
    $tbw->table_body_column_end();
    $tbw->table_row_end();
    echo "</form>";
    /*----------*/
    $tbw->table_end();
    /*-----------------------------------------------------------------------*/
    $bx->box_body_end();
    $bx->box_end();
} else {
    if ($action == "delete") {
        // DELETE
        $id = rawurldecode($id);
        $solu_id = rawurldecode($solu_id);
        $db_del = new DB_SourceLines();
        $query = "SELECT * FROM tbldocument WHERE document_id = '{$id}' AND solutions_id = '{$solu_id}'";
        $db_del->query($query);
        $db_del->next_record();
        /*-----------------------------------------------------------------------*/
        $bx->box_begin();
        $bx->box_title($t->translate("Delete document"));
        $bx->box_body_begin();
        /*-----------------------------------------------------------------------*/
        echo "<form action='" . $sess->url(basename($PHP_SELF)) . "' method='POST'>";
        $tbw->table_begin();
        // title
        $tbw->table_row_begin();
        $tbw->table_body_column_begin();
        echo "<b>" . $t->translate("Title") . ":</b>";
        $tbw->table_body_column_next(2);
示例#9
0
require "./include/prepend.php3";
page_open(array("sess" => "SourceLines_Session"));
// Disabling cache
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// HTTP/1.0
require "./include/config.inc";
require "./include/lib.inc";
require "./include/translation.inc";
require "./include/lang.inc";
require "box.inc";
$t = new translation($la);
$db = new DB_SourceLines();
$bx = new box("95%", $th_box_frame_color, 0, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta http-equiv="expires" content="0">
   <meta http-equiv="Refresh" content="1200; URL=<?php 
echo $sys_url . "sitebar.php";
?>
">
   <title><?php 
echo $sys_name;
?>
 - <?php 
 if ($action == "add") {
     // ADD
     $solu_id = rawurldecode($solu_id);
     /*-----------------------------------------------------------------------*/
     $bx->box_begin();
     $bx->box_title($t->translate("Add a component"));
     $bx->box_body_begin();
     /*-----------------------------------------------------------------------*/
     echo "<form action='" . $sess->url(basename($PHP_SELF)) . "' method='POST'>";
     $tbw->table_begin();
     // componenttype
     $tbw->table_row_begin();
     $tbw->table_body_column_begin();
     echo "<b>" . $t->translate("Type") . ":</b>";
     $tbw->table_body_column_next(2);
     $db_sel = new DB_SourceLines();
     $query = "SELECT * FROM tblcomponenttype ORDER BY componenttype_name";
     $db_sel->query($query);
     echo "<select name='componenttype_id' size='1'>";
     while ($db_sel->next_record()) {
         echo "<option value=" . $db_sel->f("componenttype_id") . ">" . $t->translate($db_sel->f("componenttype_name")) . "</option>";
     }
     if ($db_sel->num_rows() > 0) {
         $db_sel->seek(0);
     }
     echo "</select>";
     $tbw->table_body_column_end();
     // component_name
     $tbw->table_row_next();
     $tbw->table_body_column_begin();
     echo "<b>" . $t->translate("Name") . ":</b>";
 // !!!
 /*=========================*/
 if (!isset($solu_id)) {
     // 1. Eintrag, u.a. zur Bestimmung der solu_id!!!
     $random = rand(0, 2147000000);
     $query = "INSERT tblsolutions(solutions_name,username,solutions_create_date,solutions_modify_date) VALUES('{$random}','{$username}','" . date("Y-m-d H:i:s") . "','" . date("Y-m-d H:i:s") . "')";
     debug($query);
     $db->query($query);
     /*-----*/
     // Bestimmung von $solu_id
     $query = "SELECT * FROM tblsolutions WHERE solutions_name='{$random}' AND username='******'";
     debug($query);
     $db->query($query);
     $db->next_record();
     $solu_id = $db->f("solutions_id");
     $db1 = new DB_SourceLines();
     $query = "UPDATE tblsolutions SET solutions_name='no_name' WHERE solutions_id = '{$solu_id}'";
     debug($query);
     $db1->query($query);
     $where = "";
 } else {
     if ($perm->have_perm("admin")) {
         $where = "";
     } else {
         $where = " AND tblsolutions.username='******'";
     }
 }
 $query = "SELECT * FROM tblsolutions,auth_user WHERE solutions_id='{$solu_id}' {$where}  AND tblsolutions.username = auth_user.username";
 debug($query);
 /*---------------------------------------- Daten der aktuellen Seite */
 $db->query($query);
     $bx->box_end();
 } else {
     if ($action == "add") {
         // ADD
         $bx->box_begin();
         $bx->box_title($t->translate("Add a language"));
         $bx->box_body_begin();
         /*-----------------------------------------------------------------------*/
         echo "<form action='" . $sess->url(basename($PHP_SELF)) . "' method='POST'>";
         $tbw->table_begin();
         // language
         $tbw->table_row_begin();
         $tbw->table_body_column_begin();
         echo "<b>" . $t->translate("Language") . ":</b>";
         $tbw->table_body_column_next(2);
         $db_sel = new DB_SourceLines();
         $query = "SELECT * FROM tbllanguage ORDER BY language_name";
         $db_sel->query($query);
         echo "<select name='language_id' size='1'>\n";
         while ($db_sel->next_record()) {
             echo "<option value=" . $db_sel->f("language_id") . ">" . $t->translate($db_sel->f("language_name")) . "</option>\n";
         }
         echo "</select>";
         $tbw->table_body_column_end();
         // buttons
         $tbw->table_row_next();
         $tbw->table_body_column("&nbsp;");
         $tbw->table_body_column_begin();
         echo "<input type='hidden' name='action' value='db_add'>";
         echo "<input type='hidden' name='solu_id' value='{$solu_id}'>";
         echo "<input type='submit' value='" . $t->translate("Add") . "'>";