forked from Open-Web-Analytics/Open-Web-Analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added authentication plugin scheme for authenticating user when they
-- This line, and those below, will be ignored-- M owa_click.php M conf/query_strings.ini M wp_plugin.php A owa_base.php M owa_template.php A owa_user.php M public/admin/options.php M public/admin/install.php AM public/i/user_icon_large.jpg AM public/i/user_icon_small.jpg M public/reports/document_report.php M public/reports/traffic_report.php M public/reports/visitor_report.php M public/reports/visitors_report.php M public/reports/session_report.php M public/reports/click_report.php M public/reports/feeds_report.php M public/reports/dashboard_report.php M public/reports/content_report.php M public/reports/index.php A public/login.php M owa_settings_class.php A plugins/event_handlers/observer_password_reset.php A plugins/auth A plugins/auth/simple.php A plugins/auth/none.php M plugins/install/mysql/owa_install_update_to_1_0.php M plugins/install/mysql/owa_install_base.php A owa_auth.php A templates/status.tpl A templates/password_reset_request_email.tpl A templates/reset_password_form.tpl A templates/options_user_roster.tpl M templates/error.tpl A templates/login_form.tpl A templates/request_password_form.tpl A templates/password_reset_email.tpl A templates/options_edit_user_profile.tpl M templates/css.tpl M templates/options.tpl A templates/installer_set_admin_user.tpl M owa_lib.php M owa_report.php
- Loading branch information
padams
committed
Sep 8, 2006
1 parent
6d53d3a
commit a412cf5
Showing
42 changed files
with
1,784 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<? | ||
|
||
// | ||
// 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$ | ||
// | ||
require_once(OWA_BASE_DIR.'/owa_base.php'); | ||
/** | ||
* User Authentication Object | ||
* | ||
* @author Peter Adams <[email protected]> | ||
* @copyright Copyright © 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 | ||
*/ | ||
class owa_auth extends owa_base { | ||
|
||
/** | ||
* User object | ||
* | ||
* @var unknown_type | ||
*/ | ||
var $u; | ||
|
||
/** | ||
* Array of permission roles that users can have | ||
* | ||
* @var array | ||
*/ | ||
var $roles; | ||
|
||
/** | ||
* Database Access Object | ||
* | ||
* @var unknown_type | ||
*/ | ||
var $db; | ||
|
||
var $status_msg; | ||
|
||
/** | ||
* Abstract class Constructor | ||
* | ||
* @return owa_auth | ||
*/ | ||
function owa_auth() { | ||
|
||
$this->owa_base(); | ||
$this->setRoles(); | ||
|
||
return; | ||
|
||
} | ||
|
||
/** | ||
* Sets the permission levels of each role. | ||
* | ||
*/ | ||
function setRoles() { | ||
|
||
$this->roles = array('admin' => array('level' => 10, 'label' => 'Administrator'), | ||
'viewer' => array('level' => 2, 'label' => 'Report Viewer'), | ||
'guest' => array('level' => 1, 'label' => 'Guest') | ||
|
||
); | ||
|
||
return; | ||
|
||
} | ||
|
||
/** | ||
* Looks up the priviledge level for a particular role | ||
* | ||
* @param unknown_type $role | ||
* @return unknown | ||
*/ | ||
function getLevel($role) { | ||
|
||
return $this->roles['role']['level']; | ||
} | ||
|
||
function authenticateUser() { | ||
|
||
return; | ||
} | ||
|
||
/** | ||
* Creates the concrete auth class | ||
* | ||
* @return object | ||
*/ | ||
function &get_instance() { | ||
|
||
$config = &owa_settings::get_settings(); | ||
return owa_lib::singleton($config['plugin_dir'].'/auth/', | ||
'owa_auth_', | ||
$config['authentication']); | ||
} | ||
|
||
function setCookies() { | ||
|
||
setcookie($this->config['ns'].'u', $this->u->user_id, time()+3600*24*365*30, '/', $_SERVER['SERVER_NAME']); | ||
setcookie($this->config['ns'].'p', $this->u->password, time()+3600*24*365*30, '/', $_SERVER['SERVER_NAME']); | ||
|
||
return; | ||
} | ||
|
||
} | ||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<? | ||
|
||
// | ||
// 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$ | ||
// | ||
|
||
require_once('owa_env.php'); | ||
require_once('owa_settings_class.php'); | ||
require_once('owa_error.php'); | ||
/** | ||
* OWA Base Class | ||
* | ||
* @author Peter Adams <[email protected]> | ||
* @copyright Copyright © 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 | ||
*/ | ||
class owa_base { | ||
|
||
/** | ||
* Configuration | ||
* | ||
* @var array | ||
*/ | ||
var $config; | ||
|
||
/** | ||
* Error Logger | ||
* | ||
* @var object | ||
*/ | ||
var $e; | ||
|
||
/** | ||
* Base Constructor | ||
* | ||
* @return owa_base | ||
*/ | ||
function owa_base() { | ||
|
||
$this->config = &owa_settings::get_settings(); | ||
$this->e = &owa_error::get_instance(); | ||
|
||
return; | ||
} | ||
|
||
} | ||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.