Permalink
Browse files

beta release

  • Loading branch information...
1 parent f3cd2ad commit 54bbd9dce4d4d96d43117baf259ea2b0909ea4e8 @dkuntz2 dkuntz2 committed Dec 9, 2011
@@ -1,3 +1,7 @@
-<?php
-
+<?php
+$enabled_ext[] = "UserSpy";
+$enabled_ext[] = "CityFinder";
+$enabled_ext[] = "GrapeOS";
+$enabled_ext[] = "GrapePages";
+$enabled_ext[] = "GrapeReferrers";
?>
View
@@ -5,10 +5,9 @@
$db['user'] = "root";
$db['pass'] = "";
-$cms['timezone'] = "America/Chicago
-";
+$cms['timezone'] = "America/Chicago";
$cms['display_protect'] = "0";
$cms['location'] = "http://127.0.0.1/grapefruit/";
$cms['theme'] = "default";
-$cms['site'] = "127.0.0.1";
+$cms['site'] = "127.0.0.1/grapefruit";
?>
@@ -5,8 +5,7 @@
$db['user'] = "root";
$db['pass'] = "";
-$cms['timezone'] = "America/Chicago
-";
+$cms['timezone'] = "America/Chicago";
$cms['display_protect'] = "0";
$cms['location'] = "http://localhost/grapefruit/";
$cms['theme'] = "default";
@@ -538,6 +538,7 @@ function sql_protect($value) {
//
// Function to support shorter URLs.
function get_short_url($location) {
+ return null;
/*
Description: Get a _GET variable from
Why?: Normally, $_GET[''] does not work. This function allows you to use it.
@@ -559,12 +560,17 @@ function get_short_url($location) {
$value = explode("=", $query_parts[$location]);
// If the _GET variable that was split has no value, it means we put the value as the _GET variable name instead.
- if ($value[1] == "") {
- // Give the resulting value.
- return $value[0];
- } else {
- // Give the resulting value.
- return $value[1];
+ if (count($value) > 1) {
+ if ($value[1] == "") {
+ // Give the resulting value.
+ return $value[0];
+ } else {
+ // Give the resulting value.
+ return $value[1];
+ }
+ }
+ else {
+ return $value[0];
}
}
@@ -42,9 +42,7 @@
<div id="container">
<header>
- <h1><a href="<?php echo $location; ?>./"><?php echo $cms['site']; ?> <span>analytics</span></a></h1>
-
- <?php if (is_admin()) { echo "<a href=\"" .$location. "panel.php\">Admin Panel</a>"; } else { echo "<a href=\"" .$location. "login.php\">Login</a>"; } ?>
+ <h1><a href="<?php echo $location; ?>./">Grapefruit <span>analytics</span></a></h1>
</header>
<section id="notice">
@@ -212,6 +212,10 @@ div [rel="GrapePages"], div[rel="GrapeReferrers"] {
.left, div[rel="GrapeReferrers"], div[rel="GrapePages"], div[rel="GrapeOS"] {
width:300px;
float:right;
+
+ input[type="text"], input[type="password"] {
+ min-width:280px;
+ }
}
#osPlaceholder {
View
@@ -12,12 +12,12 @@
require("includes/simple_gui.php");
exit();
}
-
-$pg['title'] .= "Install";
-$pg['head'] .= "";
-$pg['body'] .= "";
-$pg['notice'] .= "";
-$pg['content'] .= "<div class=\"location\">
+$pg = array();
+$pg['title'] = "Install";
+$pg['head'] = "";
+$pg['body'] = "";
+$pg['notice'] = "";
+$pg['content'] = "<div class=\"location\">
<b>Admin</b>
<span>&gt;</span>
<span><a href=\"?\">Install</a></span>
@@ -96,22 +96,8 @@
// includes/ - To add the 'installed' lock file.
// includes/config.php - To write settings to.
// extensions/extensions.php - To enable/disable extensions.
- //
- // NEW - check to see if there is an extensions/extensions.php,
- // and if not, check to see if there's an extensions/extensions.empty.php
if (is_writable($location. "includes/config.php") && is_writable($location. "includes/") && is_writable($location. "extensions/extensions.php")) {
- if (file_exists($location. "extensions/extensions.empty.php")) {
- if (copy($location. "extensions/extensions.php", $location. "extensions/extensions.empty.php")) {
- $writable = "<img src=\"images/yes.png\" alt=\"\" /> Yes";
- }
- else {
- $writable = "<img src=\"images/no.png\" alt=\"\" /> No";
- $meet_req = 0;
- }
- }
- else {
- $writable = "<img src=\"images/yes.png\" alt=\"\" /> Yes";
- }
+ $writable = "<img src=\"images/yes.png\" alt=\"\" /> Yes";
} else {
$writable = "<img src=\"images/no.png\" alt=\"\" /> No";
$meet_req = 0;
View
@@ -15,144 +15,61 @@
exit();
}
+if (isset($_POST['pass']) && $_POST['pass'] == $_POST['pass2']) {
+ $pass = sha1($_POST['pass']);
+ $query = "UPDATE " .SQL_PREFIX. "grapeaccount SET grapeaccount_password = '" .sql_protect($_POST['pass']). "' WHERE grapeaccount_id = '" .$_SESSION[$session_name]. "'";
+ $result = mysql_query($query) or die(report_error("E_DB", mysql_error(), __LINE__, __FILE__));
+}
+
// User authentication for this page!!
$pg['title'] .= "Admin Panel";
$pg['head'] .= "";
$pg['body'] .= "";
$pg['notice'] .= "";
-// Display alternative content
-$url['type'] = get_short_url("0");
-$url['id'] = get_short_url("1");
-$url['confirm'] = get_short_url("2");
-if ($url['type'] == "update") {
- $pg['content'] .= "<div class=\"box main-box\">
-<a href=\"panel.php\"><b>Admin</b></a>
-<span>&gt;</span>
-<span><a href=\"?\">Update</a></span>
-</div>";
-
- $pg['content'] .= "<div class=\"box box-full\">
-<div class=\"box-header\">Update Grape</div>
-<div class=\"box-content\">";
-
- // Both fetchurl and fetch_remote_file have been minimally tested. This feature needs to be tested!!
- //echo fetchurl($cms['updateUrl']);
- $content = fetch_remote_file($cms['updateUrl']);
- // see: http://www.ibm.com/developerworks/library/x-xmlphp1.html
- $dom = new domDocument;
- $dom->loadXML($content);
- if (!$dom) {
- report_error("E_MSG", "Error parsing the xml update document.", __FILE__, __LINE__);
- exit;
- }
-
- $xml = simplexml_import_dom($dom);
- // Run through xml until an entry for this software is found.
- $found = 0;
- foreach ($xml as $software) {
- if ($software->name == $cms['name']) {
- $found = 1;
- if ($software->version > $cms['version']) {
- $pg['content'] .= "<p>A new " .$cms['name']. " release, version " .$software->versionFull. ", is available.</p>";
- if ($software->releaseNotes != "") {
- $pg['content'] .= "<p>" .$software->releaseNotes. "</p>";
- }
-$pg['content'] .= "<input type=\"button\" value=\"View Website\" onclick=\"document.location.href = '" .$software->websiteUrl. "';\" />
-<input type=\"button\" value=\"Direct Download\" onclick=\"document.location.href = '" .$software->downloadUrl. "';\" />
-<input type=\"button\" value=\"Cancel\" onclick=\"document.location.href = '?';\" />";
- } else {
- $pg['content'] .= "<p>No new update was found. You are using the latest version.</p>
-<input type=\"button\" value=\"Okay\" onclick=\"document.location.href = '?';\" />";
- }
+$pg['content'] .= "
+
+ <div class=\"main\">
+ <section>
+ <h2>Admin</h2>
+ <ul>
+ <li><a href=\"#\" onClick=\"pass\">Change Password</a></li>
+ <li><a href=\"#\" onClick=\"code\">Get Code</a></li>
+ </ul>
+ </section>
+ </div>
+
+ <div class=\"left\">
+ <img src=\"$location/includes/themes/default/logo-small.png\" alt=\"Grapefruit\" />
+
+ <div id=\"stuff\">
+ ".
+ (isset($_POST['pass']) && $_POST['pass'] == $_POST['pass2'] ? "Password Changed" : "")
+ . "&nbsp;</div>
+ </div>
+
+ <script>
+ function pass() {
+ $('#stuff').html(
+ \"
+ <form method=\"post\" action=\"?pass\">
+ <label for=\"pass\">Password</label><br />
+ <input type=\"password\" name=\"pass\" /><br />
+
+ <label for=\"pass2\">Confirm Password</label><br />
+ <input type=\"password\" name=\"pass2\" />
+
+ </form>
+ \"
+ )
}
- //echo $software->name. ' version ' .$software->version. '<br />';
- }
- //http://www.openjs.com/scripts/jx/
- if ($found == 0) {
- $pg['content'] .= "<p>No update information was found.
-You should manually check for updates at Grape's <a href=\"http://www.quate.net/grape\" target=\"_blank\">website</a>.</p>
-<input type=\"button\" value=\"Okay\" onclick=\"document.location.href = '?';\" />";
- }
-
-$pg['content'] .= "</div>
-</div>";
-
- require_once($template_location);
- exit();
-} else if ($url['type'] == "code") {
- $pg['content'] .= "<div class=\"box main-box\">
-<a href=\"panel.php\"><b>Admin</b></a>
-<span>&gt;</span>
-<span><a href=\"?\">Code</a></span>
-</div>";
-
- $pg['content'] .= "<div class=\"box box-full\">
-<div class=\"box-header\">Get Tracking Code</div>
-<div class=\"box-content\"><p>Copy the following javascript code to all pages you want to track statistics for.
-If you are using some content management system, you probably only need to paste this code once into the template of your website.</p>
-<div class=\"code-box\"><code>&lt;script src=\"" .$cms['location']. "?js\" type=\"text/javascript\"&gt;&lt;/script&gt;<br /></code></div>
-<input type=\"button\" value=\"Okay\" onclick=\"document.location.href = '?';\" />
-</div>
-</div>";
- //echo fetchurl($cms['updateUrl']);
- //echo fetch_remote_file($cms['updateUrl']);
- //http://www.openjs.com/scripts/jx/
- require_once($template_location);
- exit();
-} else if ($url['type'] == "about") {
- $pg['content'] .= "<div class=\"box main-box\">
-<a href=\"panel.php\"><b>Admin</b></a>
-<span>&gt;</span>
-<span><a href=\"?\">About</a></span>
-</div>";
-
- $pg['content'] .= "<div class=\"box box-full\">
-<div class=\"box-header\">About " .$cms['name']. "</div>
-<div class=\"box-content\">
-<p><img src=\"" .$location. "includes/themes/" .$cms['theme']. "/images/logo.png\" alt=\"" .$cms['name']. "\" /></p>
-<p><small>Version " .$cms['versionFull']. "</small></p>
-<p><small>Timezone: " .$cms['timezone']. "</small></p>
-<p>Grape is a free, open source program that allows web developers to keep accurate statistics of visitors.</p>
-<p>This software makes use of the following projects:</p>
-<ul>
-<li>Tango Project icons <a href=\"http://tango.freedesktop.org/Tango_Desktop_Project\" target=\"_blank\"><img src=\"" .$location. "images/link.png\"></a> <i>CC Attribution Share-Alike 2.5 License</i></li>
-<li>Secure Hash Algorithm javascript algorithm by Paul Johnston <a href=\"http://pajhome.org.uk/crypt/md5/\" target=\"_blank\"><img src=\"" .$location. "images/link.png\"></a> <i>BSD License</i></li>
-</ul>
-<p>Please visit <a href=\"http://www.quate.net/board/\" target=\"_blank\">our forums</a> if you are having any problems.</p>
-<input type=\"button\" value=\"Okay\" onclick=\"document.location.href = '?';\" />
-</div>
-</div>";
- //echo fetchurl($cms['updateUrl']);
- //echo fetch_remote_file($cms['updateUrl']);
- //http://www.openjs.com/scripts/jx/
-
- require_once($template_location);
- exit();
-}
-
-//
-$pg['content'] .= "<div class=\"box box-full\">
-<div class=\"box-header\">Administrator Panel</div>
-<div class=\"box-content\">
-<b>Admin</b><br />
-<img src=\"images/icons/statistics.png\" alt=\"\" /> <a href=\"./\">View Statistics</a><br />
-<img src=\"images/icons/extensions.png\" alt=\"\" /> <a href=\"extensions.php\">Manage Extensions</a><br />
-<img src=\"images/icons/get-code.png\" alt=\"\" /> <a href=\"?code\">Get Tracking Code</a><br />
-
-<br />
-<b>Maintenance</b><br />
-<img src=\"images/icons/update.png\" alt=\"\" /> <a href=\"?update\">Check for Updates</a><br />
-<img src=\"images/icons/about.png\" alt=\"\" /> <a href=\"?about\">About/Credits</a><br />
-
-<br />
-<b>Account</b><br />
-<img src=\"images/icons/settings.png\" alt=\"\" /> <a href=\"account.php\">Account Settings</a><br />
-<img src=\"images/icons/logout.png\" alt=\"\" /> <a href=\"login.php?logout\">Logout</a><br />
-</div>";
-$pg['content'] .= "</div>";
+ function code() {
+ $('#stuff').html ()
+ }
+ </script>
+";
require_once($template_location);
?>
View
@@ -1,18 +1,7 @@
# Todo - Grapefruit
This is a list of things that should be worked on for the first beta release of Grapefruit
-(for those unaware, the current status of CleanerGrape is SUPER DEVELOPMENT, DON'T TRY IF YOU
-DON'T WANT BUGS).
-
-## Big Things
-
- 1. FIX the extensions to grab the last 30 days, like the main counter. All of them currently only do that if
- you're in the same month... PROBLEM!
-
- 2. Update the styles to fit "grapefruit" name, and in general too...
-
- 3. Create a SearchTerms extension (in progress. The referrer extension should now record what I
- need for it to work (because it's nice to know what search terms get people to your site)).
+(for those unaware, the current status of CleanerGrape is SUPER DEVELOPMENT, DON'T TRY IF YOU DON'T WANT BUGS).
## Fun Things

0 comments on commit 54bbd9d

Please sign in to comment.