Skip to content

Commit

Permalink
checking in initial framework/module refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
padams committed Jan 23, 2007
1 parent 75459dc commit 697b07e
Show file tree
Hide file tree
Showing 312 changed files with 49,689 additions and 5,219 deletions.
565 changes: 284 additions & 281 deletions asyncEventProcessor.php

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions conf/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php

//
// Open Web Analytics - An Open Source Web Analytics Framework
//
// Copyright 2006 Peter Adams. All rights reserved.
//
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// $Id$
//


/**
* Messages and Strings file
*
* @author Peter Adams <[email protected]>
* @copyright Copyright &copy; 2006 Peter Adams <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
* @category owa
* @package owa
* @version $Revision$
* @since owa 1.0.0
*/

$_owa_messages = array(

// Login related
2000 => array("An e-mail containing instructions on how to complete the password reset process has been sent to %s",1),
2001 => array("The e-mail <B>%s</B> was not found in our database. Please check the address and try again.",1),
2002 => array("<B>Login Failed</B>. Your user name or password did not match.",0),
2003 => array("Your Account lacks the necessary priviledges to access the requested resource.",0),
2004 => array("You must login to access the requested resource."),
2010 => array("Sucess. Logout Complete.",0),

// Options/Configuration related
2500 => array("Options Saved."),

//User managment
3000 => array("Success. User Added.", 0),
3001 => array("Error. That user name is already taken.",0),
3002 => array("The form data that you entered contained one or more errors. Please check the data and submit the from again."),
3003 => array("Success. User profile saved.",0),
3004 => array("Success. User acount deleted."),
3005 => array("Enter Your New Password", 0),
3006 => array("Success. Your password will be changed shortly. This may take a few minutes.",0),
3007 => array("Error. Your passwords must match.",0),
3008 => array("Error. Your password must be %s characters long.", 1),

//sites management
3200 => array("Error. Please fill in all required fields.",0),
3201 => array("Success. Site Profile Updated.",0),
3202 => array("Success. Site Added.",0),
3203 => array("Error. Site Could not be added",0),
3204 => array("Success. Site Deleted.",0),
3206 => array("Error. I site with that domain already exists.",0),
3207 => array("Error. You must enter a domain when adding a web site.",0),

//install
3300 => array("Could not connect to the database. Please check the database connection settings in your configuration file and try again.",0),
3301 => array("The version of PHP installed on this server is too old. Please upgrade to at least PHP 4."),
3302 => array("Database Schema Installation failed. Please check the error log file for more details.",0),
3303 => array("Success. Default Site Added.",0),
3304 => array("Success. Admin User Added.",0),
3305 => array("Success. Base Database Schema Installed.",0),
3306 => array("Error. User id already exists for some reason.",0),

// Graph related
3500 => array("There is no data for\nthis time period.",0)

);


?>
6 changes: 3 additions & 3 deletions eventQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function &get_instance() {
//Create a normal event queue using 'queue' which is an extension to PEAR LOG.
$eq = Log::singleton('queue', '', 'event_queue');

if ($dir = @opendir(OWA_PLUGINS_DIR.'/event_handlers')):
/* if ($dir = @opendir(OWA_PLUGINS_DIR.'/event_handlers')):
while (($file = @readdir($dir)) !== false) {
if (strstr($file, '.php') &&
substr($file, -1, 1) != "~" &&
Expand All @@ -95,8 +95,8 @@ function &get_instance() {
}
@closedir($dir);
endif;
endif;
endif; */
endif;
endif;

return $eq;
Expand Down
3 changes: 3 additions & 0 deletions includes/Log-1.9.8/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,10 @@ function detach($observer)
function _announce($event)
{
foreach ($this->_listeners as $id => $listener) {

if ($event['priority'] <= $this->_listeners[$id]->_priority) {


$this->_listeners[$id]->notify($event);
}
}
Expand Down
142 changes: 142 additions & 0 deletions includes/base64.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/

var Base64 = {

// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

// public method for encoding
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;

input = Base64._utf8_encode(input);

while (i < input.length) {

chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);

enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;

if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}

output = output +
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);

}

return output;
},

// public method for decoding
decode : function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;

input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

while (i < input.length) {

enc1 = this._keyStr.indexOf(input.charAt(i++));
enc2 = this._keyStr.indexOf(input.charAt(i++));
enc3 = this._keyStr.indexOf(input.charAt(i++));
enc4 = this._keyStr.indexOf(input.charAt(i++));

chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;

output = output + String.fromCharCode(chr1);

if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}

}

output = Base64._utf8_decode(output);

return output;

},

// private method for UTF-8 encoding
_utf8_encode : function (string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";

for (var n = 0; n < string.length; n++) {

var c = string.charCodeAt(n);

if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}

}

return utftext;
},

// private method for UTF-8 decoding
_utf8_decode : function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;

while ( i < utftext.length ) {

c = utftext.charCodeAt(i);

if (c < 128) {
string += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
}
else {
c2 = utftext.charCodeAt(i+1);
c3 = utftext.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}

}

return string;
}

}
Loading

0 comments on commit 697b07e

Please sign in to comment.