} $title = "<a href=\"" . htmlentities($sess->self_url() . $sess->add_query(array("action" => $action2, "id" => $db_appid))) . "\"><img src=\"images/recycled.png\" border=0 alt=\"" . $t->translate("Update") . "\"></a>\n"; $bx->box_title($title); break; case "update": $db3 = new DB_SourceWell(); $db3->query("UPDATE software SET modification='{$db2_creation_his}' WHERE appid='{$db_appid}'"); $timestamp = mktimestamp($db2_creation_his); $title = "Modification date is updated to " . timestr($timestamp) . "\n"; $bx->box_title($title); break; case "insert": $db3 = new DB_SourceWell(); $db_user = $db->f("user"); $db_version = $db->f("version"); $db3->query("INSERT history SET appid='{$db_appid}', user_his='{$db_user}', creation_his='{$db_modification}', version_his='{$db_version}'"); // echo "<p>INSERT history SET appid='$db_appid', user_his='$db_user', creation_his='$db_modification', version_his='$db_version'\n"; $timestamp = mktimestamp($db_modification); $title = "History date is updated to " . timestr($timestamp) . "\n"; $bx->box_title($title); break; default: $be->box_full($t->translate("Error"), $t->translate("Invalid action")); break; } $bx->box_end(); $i++; } } if ($i < 1) { $msg = $t->translate("All dates are consistent");
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>http:" . $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>http:" . $sys_logo_small_image . "</url>\n"; echo " <link>http:" . $sys_url . "</link>\n"; echo " <description>" . $sys_name . " - " . $sys_title . "</description>\n"; echo " <width>124</width>\n"; echo " <height>32</height>\n"; echo " </image>\n"; $db = new DB_SourceWell(); $db->query("SELECT * FROM software,counter,auth_user WHERE software.appid=counter.appid AND software.user=auth_user.username AND software.status='A' ORDER BY software.modification DESC limit 10"); $i = 0; while ($db->next_record()) { echo " <item>\n"; echo " <title>" . htmlspecialchars($db->f("name")) . " " . $db->f("version") . "</title>\n"; echo " <link>http:" . $sys_url . "appbyid.php?id=" . $db->f("appid") . "</link>\n"; // echo " <description>".wrap($db->f("description"))."</description>\n"; echo " <guid>http:" . $sys_url . "appbyid.php?id=" . $db->f("appid") . "</guid>\n"; echo " </item>\n"; $i++; } echo " </channel>\n"; echo "</rss>\n";
<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_SourceWell(); 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> ]
echo "<td><input type=\"submit\" value=\"" . $t->translate("Delete") . "\">"; echo "</td></tr>\n"; echo "</form>\n"; echo "</table>\n"; $bx->box_body_end(); $bx->box_end(); } } else { $db->query("SELECT appid,modification FROM software WHERE category = '{$category}' and section='{$section}'"); $affected_apps = $db->num_rows(); // All the affected apps are treated as modified $db2 = new DB_SourceWell(); while ($db->next_record()) { $modification = $db->f("modification"); $appid = $db->f("appid"); $db2->query("UPDATE software SET status='M',modification='{$modification}' WHERE appid='{$appid}'"); } $db->query("DELETE from categories WHERE section='{$section}' AND category='{$category}'"); if ($db->affected_rows() == 1) { $bx->box_full($t->translate("Administration"), $t->translate("Deletion succesfully completed affecting") . " {$affected_apps} " . $t->translate("applications")); } } } if (!isset($del_category) && !isset($new_category)) { // It's already in our database // but no rename and no deletion... ->error $be->box_full($t->translate("Error"), $t->translate("Category") . " {$section}/{$category} " . $t->translate("already exists!")); } } else { // If section is not in table, insert it $db->query("INSERT INTO categories VALUES ('{$section}','{$category}')");
$numiter = $db->f("COUNT(*)") / 10; $limit = "{$iter},10"; $db->query("SELECT DISTINCT developer,email FROM software WHERE developer LIKE '{$by}' ORDER BY developer ASC LIMIT {$limit}"); $bx->box_begin(); $bx->box_title($t->translate("Authors")); $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># " . $t->translate("Apps") . "</b></td><td><b>" . $t->translate("Names") . "</b></td><td><b>" . $t->translate("E-Mail") . "</b></td></tr>\n"; $i = 1; while ($db->next_record()) { $developer = addslashes($db->f("developer")); $email = $db->f("email"); $db2 = new DB_SourceWell(); $db2->query("SELECT COUNT(*) FROM software WHERE developer='{$developer}' AND email='{$email}' AND status='A'"); $db2->next_record(); if ($db2->f("COUNT(*)")) { $num = "[" . sprintf("%03d", $db2->f("COUNT(*)")) . "]"; echo "<tr><td>" . sprintf("%d", $i) . "</td>\n"; if (empty($developer)) { echo "<td><a href=\"" . htmlentities($sess->url("appbydev.php") . $sess->add_query(array("developer" => "", "email" => "{$email}"))) . "\">{$num}</a></td>\n"; echo "<td>" . $t->translate("Unknown") . "</td>\n"; } else { echo "<td><a href=\"" . htmlentities($sess->url("appbydev.php") . $sess->add_query(array("developer" => $db->f("developer"), "email" => "{$email}"))) . "\">{$num}</a></td>\n"; echo "<td>" . $db->f("developer") . "</td>\n"; } if (!empty($email)) { echo "<td><<a href=\"mailto:" . mailtoencode($email) . "\">" . ereg_replace("\\.", " dot ", ereg_replace("@", " at ", htmlentities($email))) . "</a>></td>\n"; } else { echo "<td> </td>\n";
// 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; } if (strlen($rest) > 0) { $be->box_full($t->translate("Error"), $t->translate("Invalid email address") . "."); break; } 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; } /* 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") . "!<br>" . $t->translate("Please select a different Username") . "."); break; } // Create a uid and insert the user... $u_id = md5(uniqid($hash_secret)); $modification_usr = "******"; $creation_usr = "******"; $permlist = "user_pending"; $query = "insert into auth_user values('{$u_id}','{$username}','{$password}','{$realname}','{$email_usr}',{$modification_usr},{$creation_usr},'{$permlist}')"; $db->query($query); if ($db->affected_rows() == 0) { $be->box_full($t->translate("Error"), $t->translate("Registration of new User failed") . ":<br> {$query}"); break; }
$bx = new box("95%", $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 echo "<table border=0 align=center cellspacing=0 cellpadding=0 width=\"100%\">\n"; echo "<tr><td width=\"40%\" valign=top>\n"; $bx->box_begin(); $bx->box_title($t->translate("Sections")); $bx->box_body_begin(); $db->query("SELECT DISTINCT section FROM categories"); while ($db->next_record()) { $current_section = $db->f("section"); $db2 = new DB_SourceWell(); $db2->query("SELECT COUNT(*) FROM software WHERE section='{$current_section}' AND status='A'"); $db2->next_record(); $num = "[" . sprintf("%03d", $db2->f("COUNT(*)")) . "]"; echo "{$num} <a href=\"" . htmlentities($sess->url("categories.php") . $sess->add_query(array("section" => $db->f("section")))) . "\">" . $db->f("section") . "<br></a>\n"; } $bx->box_body_end(); $bx->box_end(); ?> </td> <td width="60%" valign=top> <?php if (isset($section)) { $db->query("SELECT category FROM categories WHERE section='{$section}' ORDER BY category ASC"); $bx->box_begin();
if (isset($license) && !empty($license)) { // Look if License is already in table $db->query("SELECT * FROM licenses WHERE license='{$license}'"); if ($db->num_rows() > 0) { if (isset($new_license)) { // If license in database and a new name is given, then rename if (!empty($new_license)) { $db->query("SELECT appid,modification FROM software WHERE license = '{$license}'"); // All the affected apps are treated as modified // BUT they are assigned to the new license!!!! $affected_apps = $db->num_rows(); while ($db->next_record()) { $modification = $db->f("modification"); $appid = $db->f("appid"); $db_rename = new DB_SourceWell(); $db_rename->query("UPDATE software SET status='M',license='{$new_license}',modification='{$modification}' WHERE appid='{$appid}'"); } $db->query("UPDATE licenses SET license='{$new_license}' WHERE license='{$license}'"); if ($db->affected_rows() == 1) { $bx->box_full($t->translate("Administration"), $t->translate("License") . " {$license} " . $t->translate("has been renamed to") . " {$new_license} " . $t->translate("affecting") . " {$affected_apps} " . $t->translate("applications")); } } else { // License is a blank line $be->box_full($t->translate("Error"), $t->translate("License name not specified")); } } if (isset($new_url)) { // If license in database and a new url is given, then go for it if (!empty($new_url)) { $db->query("UPDATE licenses SET url='{$new_url}' WHERE license='{$license}'"); $bx->box_full($t->translate("Administration"), $t->translate("License") . " {$license} " . $t->translate("has a new URL:") . " {$new_url}");
$query = "SELECT {$columns} FROM {$tables} WHERE {$where}"; $db->query($query); $db->next_record(); $numiter = $db->f("COUNT(*)") / 10; $limit = "{$iter},10"; $db->query("SELECT DISTINCT * FROM licenses WHERE license LIKE '{$by}' ORDER BY license ASC LIMIT {$limit}"); $bx->box_begin(); $bx->box_title($t->translate("Licenses")); $bx->box_body_begin(); $i = 1; echo "<table border=0 align=center cellspacing=1 cellpadding=1 width=\"100%\">\n"; echo "<tr><td><b>" . $t->translate("No") . ".</b></td><td><b># " . $t->translate("Apps") . "</b></td><td><b>" . $t->translate("License") . "</b></td></tr>\n"; while ($db->next_record()) { $license = $db->f("license"); $db2 = new DB_SourceWell(); $db2->query("SELECT COUNT(*) FROM software WHERE license='{$license}' AND status='A'"); $db2->next_record(); $num = "[" . sprintf("%03d", $db2->f("COUNT(*)")) . "]"; echo "<tr><td>{$i}</td><td><a href=\"" . htmlentities($sess->url("appbylic.php") . $sess->add_query(array("license" => $license))) . "\">{$num}</a></td><td><a href=\"" . $db->f("url") . "\" target=\"_blank\">" . $license . "</a></td></tr>\n"; $i++; } echo "</table>\n"; $bx->box_body_end(); $bx->box_end(); if ($numiter > 1) { $url = "licenses.php"; $urlquery = array("by" => "{$by}", "find" => "{$find}"); show_more($iter, $numiter, $url, $urlquery); } ?> <!-- end content -->
echo "<input type=\"hidden\" name=\"section\" value=\"{$section}\">\n"; echo "<input type=\"hidden\" name=\"del_section\" value=\"too_late\">\n"; echo "<td><input type=\"submit\" value=\"" . $t->translate("Delete") . "\">"; echo "</td></tr>\n"; echo "</form>\n"; echo "</table>\n"; $bx->box_body_end(); $bx->box_end(); } else { // Ok, let's go for it and delete! $db->query("SELECT name,modification FROM software WHERE section='{$section}'"); // All the affected apps are treated as deleted while ($db->next_record()) { $modification = $db->f("modification"); $db2 = new DB_SourceWell(); $db2->query("UPDATE software SET status='M',modification='{$modification}' WHERE section='{$section}'"); } $db->query("DELETE from categories WHERE section='{$section}'"); if ($db->affected_rows() > 0) { $bx->box_full($t->translate("Administration"), $t->translate("Deletion succesfully completed.")); } } } if (!isset($del_section) && !isset($new_section)) { // It's already in our database, but the user wants to admin // it. We don't mind ;-) It's like inserting only a category inssec("no"); } } else { // If section is not in table, insert it inssec("yes");
$query = "SELECT {$columns} FROM {$tables} WHERE {$where}"; $db->query($query); $db->next_record(); $numiter = $db->f("COUNT(*)") / 10; $limit = "{$iter},10"; $db->query("SELECT * FROM auth_user WHERE username LIKE '{$by}' ORDER BY username ASC LIMIT {$limit}"); $bx->box_begin(); $bx->box_title($t->translate("Users") . " " . ereg_replace("%", "", $by)); $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># " . $t->translate("Apps") . "</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()) { $username = $db->f("username"); $db2 = new DB_SourceWell(); $db2->query("SELECT COUNT(*) FROM software WHERE user='******' AND status='A'"); $db2->next_record(); $num = "[" . sprintf("%03d", $db2->f("COUNT(*)")) . "]"; echo "<tr><td>" . sprintf("%d", $i) . "</td>\n"; echo "<td><a href=\"" . htmlentities($sess->url("appbyuser.php") . $sess->add_query(array("usr" => $username))) . "\">{$num}</a></td>\n"; echo "<td>" . $username . "</td>\n"; echo "<td>" . $db->f("realname") . "</td>"; echo "<td><<a href=\"mailto:" . mailtoencode($db->f("email_usr")) . "\">" . ereg_replace("@", " at ", htmlentities($db->f("email_usr"))) . "</a>></td>"; echo "</tr>\n"; $i++; } echo "</table>\n"; $bx->box_body_end(); $bx->box_end(); if ($numiter > 1) { $url = "users.php";
break; // Licenses by Email from Developer // Licenses by Email from Developer case "email_license": stats_title($t->translate("Applications listed by Licenses and Developer's Email Domain")); $url = "0"; // No URL in function stats_display $urlquery = "0"; // No URL query in function stats_display $db->query("SELECT license FROM licenses"); while ($db->next_record()) { // We need a second database connection $db2 = new DB_SourceWell(); // Total number of apps with that License $license = $db->f("license"); $db2->query("SELECT COUNT(*) FROM software WHERE license='{$license}'"); $db2->next_record(); $total = $db2->f("COUNT(*)"); if ($total > $Minimum_apps_in_license) { stats_subtitle($db->f("license")); for ($i = 1; $i < sizeof($domain_country); $i++) { $like = "%." . $domain_country[$i][0]; $db2->query("SELECT COUNT(*) FROM software WHERE license='{$license}' AND email LIKE '{$like}'"); $db2->next_record(); $num = $db2->f("COUNT(*)"); if (100 * $num / $total > $MinimumLicByEmail) { stats_display($domain_country[$i][1], $num, $url, $urlquery, $total); } } } }