Commit f4c4b364 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files
parents f64b432b 055e9a80
......@@ -26,6 +26,8 @@
defined('INTERNAL') || die();
require('session.php');
/**
* Unknown user exception
*/
......@@ -220,7 +222,6 @@ function auth_setup () {
log_debug('session timed out');
$SESSION->logout();
$SESSION->add_info_msg(get_string('sessiontimedout'));
// @todo<nigel>: if page is public, no need to show the login page again
auth_draw_login_page();
exit;
}
......@@ -269,7 +270,6 @@ function auth_get_authtype_for_institution($institution) {
function auth_check_password_change() {
global $SESSION;
log_debug('checking if the user needs to change their password');
log_debug($SESSION);
if (auth_get_authtype_for_institution($SESSION->get('institution')) == 'internal' && $SESSION->get('passwordchange')) {
log_debug('user DOES need to change their password');
require_once('form.php');
......@@ -526,6 +526,7 @@ function login_submit($values) {
$USER = call_static_method($authclass, 'get_user_info', $username);
$SESSION->login($USER);
$USER->logout_time = $SESSION->get('logout_time');
auth_check_password_change();
}
else {
// Login attempt failed
......
......@@ -220,14 +220,14 @@ class Session {
* @return string The HTML representing all of the session messages.
*/
public function render_messages() {
$result = '';
$result = '<div id="messages">';
if (isset($_SESSION['messages'])) {
foreach ($_SESSION['messages'] as $data) {
if ($data['type'] == 'ok') {
$color = 'green';
}
elseif ($data['type'] == 'info') {
$color = '#aa6;';
$color = '#aa6';
}
else {
$color = 'red';
......@@ -236,6 +236,7 @@ class Session {
}
$_SESSION['messages'] = array();
}
$result .= '</div>';
return $result;
}
......
......@@ -35,13 +35,19 @@ if (!get_config('installed')) {
redirect(get_config('wwwroot') . 'admin/index.php');
}
$smarty = smarty();
// Check for whether the user is logged in, before processing the page. After
// this, we can guarantee whether the user is logged in or not for this page.
if (!$SESSION->is_logged_in()) {
require_once('form.php');
$smarty->assign('login_form', form(auth_get_login_form()));
$form = auth_get_login_form();
$form['renderer'] = 'div';
$login_form = form($form);
}
$smarty = smarty();
if (!$SESSION->is_logged_in()) {
$smarty->assign('login_form', $login_form);
}
$smarty->display('index.tpl');
?>
......@@ -76,7 +76,6 @@ require('dml.php');
require('ddl.php');
require('constants.php');
require('web.php');
require('session.php');
// Database access functions
require('adodb/adodb-exceptions.inc.php');
......
// Expects strings array
function get_string(s) {
// @todo Still need to sprintf these strings.
var flatargs = flattenArguments(arguments);
if (arguments.length > 1) {
argstr = '(' + flatargs.slice(1).join(',') + ')';
} else {
argstr = '';
}
if (typeof(strings) == 'undefined' || typeof(strings[s]) == 'undefined') {
return '[[[' + s + argstr + ']]]';
}
return strings[s] + argstr;
}
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode: "textareas",
theme: "advanced",
plugins: "table,emotions,iespell,inlinepopups",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,fontselect,fontsizeselect,separator,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 : "link,unlink,separator,tablecontrols,separator,hr,emotions,iespell,cleanup,separator,cut,copy,paste",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left"
});
</script>
\ No newline at end of file
function displayMessage(m) {
var color = 'red';
if (m.type == 'ok') {
color = 'green';
}
else if (m.type == 'info') {
color = '#aa6;';
}
var elemid = 'messages';
if (arguments.length > 1 && typeof(arguments[1]) == 'string') {
elemid = arguments[1];
}
$(elemid).appendChild(DIV({'style':'color:'+color+';'},m.message));
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>blank_page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="mceContentBody">
</body>
</html>
// UK lang variables
tinyMCE.addToLang('',{
bold_desc : 'Bold (Ctrl+B)',
italic_desc : 'Italic (Ctrl+I)',
underline_desc : 'Underline (Ctrl+U)',
striketrough_desc : 'Strikethrough',
justifyleft_desc : 'Align left',
justifycenter_desc : 'Align center',
justifyright_desc : 'Align right',
justifyfull_desc : 'Align full',
bullist_desc : 'Unordered list',
numlist_desc : 'Ordered list',
outdent_desc : 'Outdent',
indent_desc : 'Indent',
undo_desc : 'Undo (Ctrl+Z)',
redo_desc : 'Redo (Ctrl+Y)',
link_desc : 'Insert/edit link',
unlink_desc : 'Unlink',
image_desc : 'Insert/edit image',
cleanup_desc : 'Cleanup messy code',
focus_alert : 'A editor instance must be focused before using this command.',
edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?',
insert_link_title : 'Insert/edit link',
insert : 'Insert',
update : 'Update',
cancel : 'Cancel',
insert_link_url : 'Link URL',
insert_link_target : 'Target',
insert_link_target_same : 'Open link in the same window',
insert_link_target_blank : 'Open link in a new window',
insert_image_title : 'Insert/edit image',
insert_image_src : 'Image URL',
insert_image_alt : 'Image description',
help_desc : 'Help',
bold_img : "bold.gif",
italic_img : "italic.gif",
underline_img : "underline.gif",
clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'
});
Beginning with version 2.0.5 the language packs are no
longer included with the core distribution.
Language packs can be downloaded from the TinyMCE website:
http://tinymce.moxiecode.com/download.php
The language pack codes are based on ISO-639-1:
http://www.loc.gov/standards/iso639-2/englangn.html
Plrease try using entities if possible. Like &aring; etc for non a-z characters.
This diff is collapsed.
input.radio {
border: 1px none #000000;
background-color: transparent;
vertical-align: middle;
}
.panel_wrapper div.current {
height: 80px;
}
#width {
width: 50px;
vertical-align: middle;
}
#width2 {
width: 50px;
vertical-align: middle;
}
#size {
width: 100px;
}
tinyMCE.importPluginLanguagePack('advhr');var TinyMCE_AdvancedHRPlugin={getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"advhr":return tinyMCE.getButtonHTML(cn,'lang_insert_advhr_desc','{$pluginurl}/images/advhr.gif','mceAdvancedHr')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvancedHr":var template=new Array();template['file']='../../plugins/advhr/rule.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_advhr_delta_width',0);template['height']+=tinyMCE.getLang('lang_advhr_delta_height',0);var size="",width="",noshade="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="hr"){tinyMCE.hrElement=tinyMCE.selectedElement;if(tinyMCE.hrElement){size=tinyMCE.hrElement.getAttribute('size')?tinyMCE.hrElement.getAttribute('size'):"";width=tinyMCE.hrElement.getAttribute('width')?tinyMCE.hrElement.getAttribute('width'):"";noshade=tinyMCE.hrElement.getAttribute('noshade')?tinyMCE.hrElement.getAttribute('noshade'):""}tinyMCE.openWindow(template,{editor_id:editor_id,size:size,width:width,noshade:noshade,mceDo:'update'})}else{if(tinyMCE.isMSIE){tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,'<hr />')}else{tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",size:size,width:width,noshade:noshade,mceDo:'insert'})}}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="HR"){tinyMCE.switchClass(editor_id+'_advhr','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advhr','mceButtonNormal');return true}};tinyMCE.addPlugin("advhr",TinyMCE_AdvancedHRPlugin);
\ No newline at end of file
/**
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('advhr');
var TinyMCE_AdvancedHRPlugin = {
getInfo : function() {
return {
longname : 'Advanced HR',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
}
},
getControlHTML : function(cn) {
switch (cn) {
case "advhr":
return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr');
}
return "";
},
/**
* Executes the mceAdvanceHr command.
*/
execCommand : function(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceAdvancedHr":
var template = new Array();
template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme
template['width'] = 250;
template['height'] = 160;
template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
var size = "", width = "", noshade = "";
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") {
tinyMCE.hrElement = tinyMCE.selectedElement;
if (tinyMCE.hrElement) {
size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
}
tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
} else {
if (tinyMCE.isMSIE) {
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
} else {
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
}
}
return true;
}
// Pass to next handler in chain
return false;
},
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
if (node == null)
return;
do {
if (node.nodeName == "HR") {
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected');
return true;
}
} while ((node = node.parentNode));
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal');
return true;
}
};
tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);
function init() {
tinyMCEPopup.resizeToInnerSize();
var formObj = document.forms[0];
formObj.width.value = tinyMCE.getWindowArg('width');
formObj.size.value = tinyMCE.getWindowArg('size');
formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'),'Insert',true);
if (tinyMCE.getWindowArg('noshade')) {
formObj.noshade.checked = true;
}
if (tinyMCE.getWindowArg('width').lastIndexOf('%')!=-1) {
formObj.width2.value = "%";
formObj.width.value = formObj.width.value.substring(0,formObj.width.value.length-1);
}
}
function insertHR() {
var formObj = document.forms[0];
var width = formObj.width.value;
var size = formObj.size.value;
var html = '<hr';
if (size!='' && size!=0) {
html += ' size="' + size + '"';
}
if (width!='' && width!=0) {
html += ' width="' + width;
if (formObj.width2.value=='%') {
html += '%';
}
html += '"';
}
if (formObj.noshade.checked==true) {
html += ' noshade="noshade"';
}
html += ' />';
tinyMCEPopup.execCommand("mceInsertContent", true, html);
tinyMCEPopup.close();
}
function cancelAction() {
tinyMCEPopup.close();
}
// UK lang variables
tinyMCE.addToLang('',{
insert_advhr_desc : 'Horizontale rule',
insert_advhr_width : 'Width',
insert_advhr_size : 'Height',
insert_advhr_noshade : 'No shadow'
});
Check the TinyMCE documentation for details on this plugin.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_insert_advhr_desc}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/rule.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');">
<form onsubmit="insertHR();return false;" action="#">
<div class="tabs">
<ul>
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_advhr_desc}</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<div id="general_panel" class="panel current">
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="width">{$lang_insert_advhr_width}</label></td>
<td nowrap="nowrap">
<input id="width" name="width" type="text" value="" />
<select name="width2" id="width2">
<option value="">px</option>
<option value="%">%</option>
</select>
</td>
</tr>
<tr>
<td><label for="size">{$lang_insert_advhr_size}</label></td>
<td><select id="size" name="size">
<option value="">Normal</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td>
</tr>
<tr>
<td><label for="noshade">{$lang_insert_advhr_noshade}</label></td>
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
</tr>
</table>
</div>
</div>
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertHR();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>
</body>
</html>
/* CSS file for advimage plugin popup */
.mceImageList {
width: 280px;
}
.mceActionPanel {
margin-top: 7px;
}
.alignPreview {
border: 1px solid black;
width: 140px;
height: 140px;
overflow: hidden;
padding: 5px;
}
.checkbox {
border: 0;
}
.panel_wrapper div.current {
height: 305px;
}
#prev {
margin: 0;
border: 1px
solid black;
width: 99%;
height: 150px;
overflow: auto;
}
#align, #classlist {
width: 150px;
}
#width, #height {
vertical-align: middle;
width: 50px;
text-align: center;
}
#vspace, #hspace, #border {
vertical-align: middle;
width: 30px;
text-align: center;
}
#classlist {
width: 180px;
}
input {
width: 280px;
}
#constrain, #onmousemovecheck {
width: auto;
}
#id, #dir, #lang, #usemap, #longdesc {
width: 200px;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment