# HG changeset patch # User Dan # Date 1193244305 14400 # Node ID 861807631f70218bf8f1cfef0553a0d9cee518d6 # Parent 8e2fffc5c622b5665ed59e8d20d874daf3005577# Parent 996572e55dc94fecf0b46fd196bbb97b12d0f277 Merging in fixes from stable diff -r 996572e55dc9 -r 861807631f70 ajax.php --- a/ajax.php Wed Oct 24 09:34:19 2007 -0400 +++ b/ajax.php Wed Oct 24 12:45:05 2007 -0400 @@ -2,7 +2,7 @@ /* * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.1.1 + * Version 1.0.2 (Coblynau) * Copyright (C) 2006-2007 Dan Fuhry * * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License @@ -116,7 +116,7 @@ } else { - echo 'Error saving the page: '.$e; + echo '
Error saving the page: '.$e.'
'; } break; case "protect": diff -r 996572e55dc9 -r 861807631f70 cron.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cron.php Wed Oct 24 12:45:05 2007 -0400 @@ -0,0 +1,54 @@ + $tasks ) +{ + $last_run_threshold = time() - ( $interval * 3600 ); + if ( $last_run_threshold >= $last_run ) + { + foreach ( $tasks as $task ) + { + @call_user_func($task); + } + } +} + +header('Pragma: no-cache'); +header('Cache-control: no-cache'); +header('Expires: Thu, 1 Jan 1970 00:00:01 GMT'); +header('Content-type: image/gif'); + +echo ENANO_GIF_SPACER; + +?> diff -r 996572e55dc9 -r 861807631f70 includes/clientside/sbedit.js --- a/includes/clientside/sbedit.js Wed Oct 24 09:34:19 2007 -0400 +++ b/includes/clientside/sbedit.js Wed Oct 24 12:45:05 2007 -0400 @@ -123,3 +123,71 @@ }); } +function ajaxRenameSidebarStage1(parent, id) +{ + var oldname = parent.firstChild.nodeValue; + parent.removeChild(parent.firstChild); + parent.ondblclick = function() {}; + parent._idcache = id; + var input = document.createElement('input'); + input.type = 'text'; + input.sbedit_id = id; + input.oldvalue = oldname; + input.onkeyup = function(e) + { + if ( typeof(e) != 'object' ) + return false; + if ( !e.keyCode ) + return false; + if ( e.keyCode == 13 ) + { + ajaxRenameSidebarStage2(this); + } + if ( e.keyCode == 27 ) + { + ajaxRenameSidebarCancel(this); + } + }; + input.onblur = function() + { + ajaxRenameSidebarCancel(this); + }; + input.value = oldname; + input.style.fontSize = '7pt'; + parent.appendChild(input); + input.focus(); +} + +function ajaxRenameSidebarStage2(input) +{ + var newname = input.value; + var id = input.sbedit_id; + var parent = input.parentNode; + parent.removeChild(input); + parent.appendChild(document.createTextNode(( newname == '' ? 'Username: | \ + | Username: | \ |
Password: | \ + | Password: | \ |
\
Trouble logging in? Try the full login form. '; @@ -467,21 +383,8 @@ { $('ajaxlogin_user').object.focus(); } - if ( ajax_auth_show_captcha ) - { - $('ajaxlogin_captcha_code').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); }; - $('ajaxlogin_captcha_code').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); }; - } - else - { - $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); }; - $('ajaxlogin_pass').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); }; - } - if ( disable_controls ) - { - var panel = document.getElementById('messageBoxButtons'); - panel.firstChild.disabled = true; - } + $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); }; + $('ajaxlogin_pass').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); }; /* ## This causes the background image to disappear under Fx 2 if ( shown_error ) @@ -495,11 +398,6 @@ fader.start(); } */ - if ( ajax_auth_show_captcha ) - { - ajaxShowCaptcha(ajax_auth_show_captcha); - ajax_auth_show_captcha = false; - } } }); } @@ -514,15 +412,6 @@ password = document.getElementById('ajaxlogin_pass').value; auth_enabled = false; - if ( document.getElementById('autoCaptcha') ) - { - var to = fly_out_top(document.getElementById('autoCaptcha'), false, true); - setTimeout(function() { - var d = document.getElementById('autoCaptcha'); - d.parentNode.removeChild(d); - }, to); - } - disableJSONExts(); // @@ -578,12 +467,6 @@ 'level' : ajax_auth_level_cache }; - if ( document.getElementById('ajaxlogin_captcha_hash') ) - { - json_data.captcha_hash = document.getElementById('ajaxlogin_captcha_hash').value; - json_data.captcha_code = document.getElementById('ajaxlogin_captcha_code').value; - } - json_data = toJSONString(json_data); json_data = encodeURIComponent(json_data); @@ -626,23 +509,18 @@ } break; case 'error': - if ( response.data.error == 'invalid_credentials' || response.data.error == 'locked_out' ) + if ( response.error == 'The username and/or password is incorrect.' ) { - ajax_auth_error_string = ajaxAuthErrorToString(response.data); + ajax_auth_error_string = response.error; mb_current_obj.updateContent(''); document.getElementById('messageBox').style.backgroundColor = '#C0C0C0'; var mb_parent = document.getElementById('messageBox').parentNode; new Spry.Effect.Shake(mb_parent, {duration: 1500}).start(); setTimeout("document.getElementById('messageBox').style.backgroundColor = '#FFF'; ajaxAuthLoginInnerSetup();", 2500); - - if ( response.data.lockout_policy == 'captcha' && response.data.error == 'locked_out' ) - { - ajax_auth_show_captcha = response.captcha; - } } else { - ajax_auth_error_string = ajaxAuthErrorToString(response.data); + alert(response.error); ajaxAuthLoginInnerSetup(); } break; diff -r 996572e55dc9 -r 861807631f70 includes/common.php --- a/includes/common.php Wed Oct 24 09:34:19 2007 -0400 +++ b/includes/common.php Wed Oct 24 12:45:05 2007 -0400 @@ -2,7 +2,7 @@ /* * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.1.1 + * Version 1.0.2 (Coblynau) * Copyright (C) 2006-2007 Dan Fuhry * * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License @@ -23,7 +23,7 @@ exit; } -$version = '1.1.1'; +$version = '1.0.2'; function microtime_float() { @@ -68,6 +68,9 @@ if ( file_exists( ENANO_ROOT . '/_nightly.php') ) require(ENANO_ROOT.'/_nightly.php'); +// List of scheduled tasks +$cron_tasks = array(); + // Start including files. LOTS of files. Yeah! require_once(ENANO_ROOT.'/includes/constants.php'); dc_here('Enano CMS '.$version.' (dev) - debug window Powered by debugConsole'); diff -r 996572e55dc9 -r 861807631f70 includes/functions.php --- a/includes/functions.php Wed Oct 24 09:34:19 2007 -0400 +++ b/includes/functions.php Wed Oct 24 12:45:05 2007 -0400 @@ -2796,7 +2796,7 @@ $strip_tags = implode('|', $strip_tags); // Strip out the tags and replace with placeholders - preg_match_all("#<($strip_tags)(.*?)>(.*?)($strip_tags)>#is", $html, $matches); + preg_match_all("#<($strip_tags)([ ]+.*?)?>(.*?)($strip_tags)>#is", $html, $matches); $seed = md5(microtime() . mt_rand()); // Random value used for placeholders for ($i = 0;$i < sizeof($matches[1]); $i++) { @@ -2804,7 +2804,7 @@ } // Optimize (but don't obfuscate) Javascript - preg_match_all('/ | |||
Visual confirmation: Please enter the code you see on the right. | Code: | ||
Comment text: (most HTML will be stripped) | |||
Account lockouts | |||
---|---|---|---|
Configure Enano to prevent or restrict logins for a specified period of time if a user enters an incorrect password a specific number of times. | |||
Lockout threshold: - How many times can a user enter wrong credentials before a lockout goes into effect? - |
- - - | -||
Lockout duration: - This is how long an account lockout should last, in minutes. - |
- - - | -||
Lockout policy: - What should be done when a lockout goes into effect? - |
-
- - - - |
- ||
Password strength | |||
Group name: | -' . $row['group_name'] . ' | +' . $row['group_name'] . ( $row['system_group'] == 1 ? ' (system group)' : '' ) . ' | |
Membership status: | diff -r 996572e55dc9 -r 861807631f70 plugins/SpecialPageFuncs.php --- a/plugins/SpecialPageFuncs.php Wed Oct 24 09:34:19 2007 -0400 +++ b/plugins/SpecialPageFuncs.php Wed Oct 24 12:45:05 2007 -0400 @@ -4,13 +4,13 @@ Plugin URI: http://enanocms.org/ Description: Provides the page Special:CreatePage, which can be used to create new pages. Also adds the About Enano and GNU General Public License pages. Author: Dan Fuhry -Version: 1.0.1 +Version: 1.0.2 Author URI: http://enanocms.org/ */ /* * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.0 release candidate 2 + * Version 1.0.2 * Copyright (C) 2006-2007 Dan Fuhry * * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License @@ -109,6 +109,17 @@ exit; } + if ( substr($urlname, 0, 8) == 'Project:' ) + { + $template->header(); + + echo '+ |
Forgot your password? No problem. Maybe you need to create an account. |
@@ -285,21 +198,6 @@
|
Password: | |||
Code in image: | - | ||
- - | -|||
@@ -344,12 +242,12 @@
$plugins->attachHook('login_password_reset', 'SpecialLogin_SendResponse_PasswordReset($row[\'user_id\'], $row[\'temp_password\']);');
$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
$data = $json->decode($_POST['params']);
- $captcha_hash = ( isset($data['captcha_hash']) ) ? $data['captcha_hash'] : false;
- $captcha_code = ( isset($data['captcha_code']) ) ? $data['captcha_code'] : false;
$level = ( isset($data['level']) ) ? intval($data['level']) : USER_LEVEL_MEMBER;
- $result = $session->login_with_crypto($data['username'], $data['crypt_data'], $data['crypt_key'], $data['challenge'], $level, $captcha_hash, $captcha_code);
+ $result = $session->login_with_crypto($data['username'], $data['crypt_data'], $data['crypt_key'], $data['challenge'], $level);
$session->start();
- if ( $result['success'] )
+ //echo "$result\n$session->sid_super";
+ //exit;
+ if ( $result == 'success' )
{
$response = Array(
'result' => 'success',
@@ -358,16 +256,9 @@
}
else
{
- $captcha = '';
- if ( $result['error'] == 'locked_out' && $result['lockout_policy'] == 'captcha' )
- {
- $session->kill_captcha();
- $captcha = $session->make_captcha();
- }
$response = Array(
'result' => 'error',
- 'data' => $result,
- 'captcha' => $captcha
+ 'error' => $result
);
}
$response = $json->encode($response);
@@ -376,19 +267,17 @@
exit;
}
if(isset($_POST['login'])) {
- $captcha_hash = ( isset($_POST['captcha_hash']) ) ? $_POST['captcha_hash'] : false;
- $captcha_code = ( isset($_POST['captcha_code']) ) ? $_POST['captcha_code'] : false;
if($_POST['use_crypt'] == 'yes')
{
- $result = $session->login_with_crypto($_POST['username'], $_POST['crypt_data'], $_POST['crypt_key'], $_POST['challenge_data'], intval($_POST['auth_level']), $captcha_hash, $captcha_code);
+ $result = $session->login_with_crypto($_POST['username'], $_POST['crypt_data'], $_POST['crypt_key'], $_POST['challenge_data'], intval($_POST['auth_level']));
}
else
{
- $result = $session->login_without_crypto($_POST['username'], $_POST['pass'], false, intval($_POST['auth_level']), $captcha_hash, $captcha_code);
+ $result = $session->login_without_crypto($_POST['username'], $_POST['pass'], false, intval($_POST['auth_level']));
}
$session->start();
$paths->init();
- if($result['success'])
+ if($result == 'success')
{
$template->load_theme($session->theme, $session->style);
if(isset($_POST['return_to']))
diff -r 996572e55dc9 -r 861807631f70 plugins/SpecialUserPrefs.php
--- a/plugins/SpecialUserPrefs.php Wed Oct 24 09:34:19 2007 -0400
+++ b/plugins/SpecialUserPrefs.php Wed Oct 24 12:45:05 2007 -0400
@@ -4,13 +4,13 @@
Plugin URI: http://enanocms.org/
Description: Provides the page Special:Preferences.
Author: Dan Fuhry
-Version: 1.0.1
+Version: 1.0.2
Author URI: http://enanocms.org/
*/
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0 release candidate 2
+ * Version 1.0.2
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License
diff -r 996572e55dc9 -r 861807631f70 themes/oxygen/footer.tpl
--- a/themes/oxygen/footer.tpl Wed Oct 24 09:34:19 2007 -0400
+++ b/themes/oxygen/footer.tpl Wed Oct 24 12:45:05 2007 -0400
@@ -13,6 +13,8 @@
{COPYRIGHT}
Website engine powered by Enano | Valid XHTML 1.1 | Valid CSS | Generated in [[GenTime]]sec + + |