| 1 |
<?php |
<?php |
| 2 |
// $Id: single_login.module,v 1.1.2.1 2008/10/07 21:14:30 sanduhrs Exp $ |
// $Id: single_login.module,v 1.1.2.2 2008/10/07 21:16:46 sanduhrs Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Single Login is a session management system for Drupal. |
* Single Login is a session management system for Drupal. |
| 41 |
define('SINGLE_LOGIN_HISTORY_UNAME', 'single_login_history_uname__'); |
define('SINGLE_LOGIN_HISTORY_UNAME', 'single_login_history_uname__'); |
| 42 |
|
|
| 43 |
/** |
/** |
| 44 |
|
* Implementation of hook_enable(). |
| 45 |
|
*/ |
| 46 |
|
function single_login_enable() { |
| 47 |
|
$exists = db_result(db_query("SELECT fid FROM {profile_fields} WHERE name='profile_current_session_id'")); |
| 48 |
|
if (!$exists) { |
| 49 |
|
// needed for google analytics |
| 50 |
|
db_query("INSERT INTO {profile_fields} (title, name, explanation, category, page, type, weight, required, register, visibility, autocomplete, options) VALUES ('Current Session ID', 'profile_current_session_id', 'User session ID', 'User Information', '', 'textfield', 0, 0, 0, 4, 0, '')"); |
| 51 |
|
} |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
/** |
| 55 |
* Implementation of hook_init(). |
* Implementation of hook_init(). |
| 56 |
*/ |
*/ |
| 57 |
function single_login_init() { |
function single_login_init() { |