Ejemplo n.º 1
0
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>" . $sys_name . "</title>\n";
echo "    <link>" . $sys_url . "</link>\n";
echo "    <description>" . $sys_name . " - " . $sys_title . "</description>\n";
echo "    <language>en-us</language>\n";
echo "  <image>\n";
echo "    <title>" . $sys_name . "</title>\n";
echo "    <url>" . $sys_url . $sys_logo_image . "</url>\n";
echo "    <link>" . $sys_url . "</link>\n";
echo "    <description>" . $sys_name . " - " . $sys_title . "</description>\n";
echo "    <width>66</width>\n";
echo "    <height>73</height>\n";
echo "  </image>\n";
$db = new DB_SourceContact();
$db->query("SELECT * FROM contact WHERE contact.status='A' ORDER BY contact.modification DESC limit 10");
$i = 0;
while ($db->next_record()) {
    echo "  <item>\n";
    echo "    <title>" . $db->f("name") . "</title>\n";
    echo "    <link>" . $sys_url . "conbyconid.php?id=" . $db->f("conid") . "</link>\n";
    echo "    <description>" . wrap($db->f("category")) . "</description>\n";
    echo "  </item>\n";
    $i++;
}
echo "  </channel>\n";
echo "</rss>\n";
Ejemplo n.º 2
0
# This is the text backend of the system
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session"));
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
}
header("Content-Type: text/plain");
// Disabling cache
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";
$db = new DB_SourceContact();
$db->query("SELECT * FROM contact WHERE contact.status='A' ORDER BY contact.modification DESC limit 10");
$i = 0;
while ($db->next_record()) {
    echo $db->f("name") . "\n";
    $timestamp = mktimestamp($db->f("modification"));
    echo timestr($timestamp) . "\n";
    echo $sys_url . "conbyconid.php?id=" . $db->f("conid") . "\n";
    $i++;
}
@page_close();
Ejemplo n.º 3
0
    mysql_die($db);
} else {
    $bx->box_begin();
    $bx->box_title($t->translate("Users"));
    $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("Con") . "</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()) {
        $columns = "COUNT(*)";
        $tables = "contact";
        $where = "user=\"" . $db->f("username") . "\" AND status=\"A\"";
        $num = "";
        $dbn = new DB_SourceContact();
        if ($dbn->query("SELECT {$columns} AS cnt FROM {$tables} WHERE {$where}")) {
            $dbn->next_record();
            $num = "[" . sprintf("%03d", $dbn->f("cnt")) . "]";
        }
        echo "<tr><td>" . sprintf("%d", $i) . "</td>\n";
        echo "<td><a href=\"" . $sess->url("index.php") . $sess->add_query(array("by" => "filter", "author" => $db->f("username"))) . "\">{$num}</a></td>\n";
        echo "<td>" . $db->f("username") . "</td>\n";
        echo "<td>" . $db->f("realname") . "</td>";
        echo "<td>&lt;<a href=\"mailto:" . $db->f("email_usr") . "\">" . ereg_replace("@", " at ", htmlentities($db->f("email_usr"))) . "</a>&gt;</td>";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
}
$bx->box_body_end();
Ejemplo n.º 4
0
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session"));
// Disabling cache
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 "./include/box.inc";
$t = new translation($la);
$db = new DB_SourceContact();
$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 
Ejemplo n.º 5
0
            stats_end();
            break;
            // Classifications
        // Classifications
        case "classifications":
            stats_title($t->translate("Contacts listed by Classifications"));
            $db->query("SELECT DISTINCT type, COUNT(*) AS cnt FROM categories GROUP BY type");
            while ($db->next_record()) {
                $type = $db->f("type");
                if ($db->f("cnt") > 0 && $type != "Contact") {
                    stats_subtitle($t->translate("Contact Category") . " " . $type);
                    $dbtot = new DB_SourceContact();
                    $dbtot->query("SELECT COUNT(*) FROM contact WHERE category='{$type}'");
                    $dbtot->next_record();
                    $total_number_cat = $dbtot->f("COUNT(*)");
                    $db2 = new DB_SourceContact();
                    $db2->query("SELECT class, COUNT(*) AS cnt2 FROM classifications WHERE type='{$type}' GROUP BY class");
                    while ($db2->next_record()) {
                        $cnt2 = $db2->f("cnt2");
                        if ($cnt2 > 0) {
                            $url = "index.php";
                            $urlquery = array("by" => "filter", "class" => $db2->f("class"));
                            stats_display($db2->f("class"), $cnt2, $url, $urlquery, $total_number_cat);
                        }
                    }
                }
            }
            stats_end();
            break;
    }
}
Ejemplo n.º 6
0
	<h3><?php 
echo $sys_name;
?>
 Database Connection</h3>
	<ul>
    	<li>I am now going to try to create a DB_<?php 
echo $sys_name;
?>
 database connection.<br>If an error occures, then you should look at these points and fix them before proceeding:
		<ul>
			<li>Have you introduced the correct database parameters (<i>Host</i>, <i>Database</i> name, <i>User</i> name and <i>Password</i>) in the include/local.inc file?
        	<li>Have you created the database tables and set the defaults? (you've got them in the <i>sql</i> subdirectory)
			<li>Is your database running? ;-)
		</ul>
<?php 
$db = new DB_SourceContact();
if ($db->query("SELECT * FROM auth_user")) {
    ?>
			<li><b><font color="green">Created a DB_<?php 
    echo $sys_name;
    ?>
 database connection successfully.</font></b></li>
        	<?php 
}
?>

	</ul>
	<p>[ <a href="install.php">Go back</a> ] [ <a href="install.php?action=check_session">Next</a> ]
Ejemplo n.º 7
0
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
require "./include/header.inc";
$bx = 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_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 
if ($perm->have_perm("admin")) {
    ###
    ### Submit Handler
    ###
    ## Get a database connection
    $db = new DB_SourceContact();
    // Check if there was a submission
    while (is_array($HTTP_POST_VARS) && (list($key, $val) = each($HTTP_POST_VARS))) {
        switch ($key) {
            case "create":
                // Create a new user
                if (empty($username) || empty($password) || 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;
                }
                /* Does the user already exist?
                   NOTE: This should be a transaction, but it isn't... */
                $db->query("select * from auth_user where username='******'");
                if ($db->nf() > 0) {
                    $be->box_full($t->translate("Error"), $t->translate("User") . " <B>{$username}</B> " . $t->translate("already exists") . ".");
Ejemplo n.º 8
0
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
require "./include/header.inc";
$bx = 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_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_SourceContact();
// 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;
Ejemplo n.º 9
0
} else {
    // If contact id specified
    if (isset($id)) {
        // Look if contact is already in table
        $columns = "*";
        $tables = "contact";
        $where = "conid='{$id}'";
        if (!$db->query("SELECT {$columns} FROM {$tables} WHERE {$where}")) {
            mysql_die($db);
        } else {
            // If contact in table
            if ($db->next_record()) {
                // If contact owner is logged in user
                if ($db->f("user") == $auth->auth["uname"] || $perm->have_perm("admin")) {
                    // Look if clasifications are already in table
                    $dbcla = new DB_SourceContact();
                    $columns = "*";
                    $tables = "classifications,contact";
                    $where = "classifications.conid='{$id}' AND classifications.type = '{$type}' AND contact.conid = classifications.conid";
                    if ($dbcla->query("SELECT {$columns} FROM {$tables} WHERE {$where}")) {
                        // If classifications are in table
                        if ($dbcla->next_record()) {
                            // Modify existing classifications
                            clamod($dbcla);
                        } else {
                            // Insert new classifications
                            claform($db);
                        }
                    } else {
                        mysql_die($db);
                    }
Ejemplo n.º 10
0
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
}
require "./include/header.inc";
$bx = 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_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_SourceContact();
// 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;
Ejemplo n.º 11
0
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
require "./include/header.inc";
$bx = 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_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 
if ($perm->have_perm("admin")) {
    if (isset($category) && !empty($category)) {
        $dbcat = new DB_SourceContact();
        // Look if Category is already in table
        $columns = "*";
        $tables = "categories";
        $where = "type='{$type}' AND category='{$category}'";
        if (!$dbcat->query("SELECT {$columns} FROM {$tables} WHERE {$where}")) {
            mysql_die($dbcat);
        } else {
            switch ($action) {
                case "ins":
                    if ($dbcat->num_rows() > 0) {
                        $be->box_full($t->translate("Error"), $t->translate("Category") . " {$category} " . $t->translate("already exists"));
                    } else {
                        $set = "type='{$type}',category='{$category}'";
                        if (!$dbcat->query("INSERT {$tables} SET {$set}")) {
                            mysql_die($dbcat);