commit d923755f35b5a9dd183ff820573dd94a81380e5c
parent 484d22d7c103a9736671d50a0b116786474435cd
Author: Jan Dankert <devnull@localhost>
Date: Sat, 20 Oct 2012 15:29:40 +0200
Zusammenführung.
Diffstat:
15 files changed, 199 insertions(+), 114 deletions(-)
diff --git a/action/UserAction.class.php b/action/UserAction.class.php
@@ -144,44 +144,54 @@ class UserAction extends Action
/**
* Aendern des Kennwortes
*/
- function pwPost()
+ public function pwPost()
{
global $conf;
$pw1 = $this->getRequestVar('password1');
$pw2 = $this->getRequestVar('password2');
- // Zufaelliges Kennwort erzeugen
- if ( $this->hasRequestVar('random') && $this->hasRequestVar('email') )
+ $type = $this->getRequestVar('type');
+
+ switch( $type )
{
- $pw1 = $this->user->createPassword();
- $pw2 = $pw1;
+ case 'input':
+ if ( strlen($pw1)<intval($conf['security']['password']['min_length']) )
+ {
+ $this->addValidationError('password1');
+ return;
+ }
+ elseif ( $pw1 != $pw2 )
+ {
+ $this->addValidationError('password2');
+ return;
+ }
+ else
+ {
+ $newPassword = $pw1;
+ }
+ break;
+ case 'proposal';
+ $newPassword = $this->getRequestVar('password_proposal');
+ break;
+ case 'random';
+ $newPassword = $this->user->createPassword();
+ break;
+ default:
+ Http::serverError('Type unknown: '.$type);
}
- if ( strlen($pw1)<intval($conf['security']['password']['min_length']) )
+ // Kennwoerter identisch und lang genug
+ $this->user->setPassword($pw1,!$this->hasRequestVar('timeout') ); // Kennwort setzen
+
+ // E-Mail mit dem neuen Kennwort an Benutzer senden
+ if ( $this->hasRequestVar('email') && !empty($this->user->mail) && $conf['mail']['enabled'] )
{
- $this->addValidationError('password1');
- return;
- }
- elseif ( $pw1 != $pw2 )
- {
- $this->addValidationError('password2');
- return;
- }
- else
- {
- // Kennwoerter identisch und lang genug
- $this->user->setPassword($pw1,!$this->hasRequestVar('timeout') ); // Kennwort setzen
-
- // E-Mail mit dem neuen Kennwort an Benutzer senden
- if ( $this->hasRequestVar('email') && !empty($this->user->mail) && $conf['mail']['enabled'] )
- {
- $this->mailPw( $pw1 );
- $this->addNotice('user',$this->user->name,'MAIL_SENT','ok');
- }
-
- $this->addNotice('user',$this->user->name,'SAVED','ok');
+ $this->mailPw( $pw1 );
+ $this->addNotice('user',$this->user->name,'MAIL_SENT','ok');
}
+
+ $this->addNotice('user',$this->user->name,'SAVED','ok');
}
@@ -305,6 +315,8 @@ class UserAction extends Action
function pwView()
{
$this->setTemplateVars( $this->user->getProperties() );
+
+ $this->setTemplateVar('password_proposal', $this->user->createPassword() );
}
diff --git a/language/de.ini.php b/language/de.ini.php
@@ -1098,6 +1098,7 @@ USER_MAIL_NEW_PASSWORD = "E-Mail mit dem neuen Kennwort an Benutzer senden"
USER_MEMBERSHIPS = "Mitgliedschaften"
USER_NEW_MAIL = "Neue E-Mail-Adresse"
USER_NEW_PASSWORD = "Neues Kennwort"
+USER_NEW_PASSWORD_INPUT = "Neues Kennwort eingeben"
USER_NEW_PASSWORD_REPEAT = "Neues Kennwort Wiederholung"
USER_PASSWORD = Kennwort
USER_PASSWORD_TIMEOUT =Kennwort läuft ab
diff --git a/themes/default/css/openrat.css.php b/themes/default/css/openrat.css.php
@@ -1,3 +1,4 @@
+<?php header('Content-Type: text/css',true) ?>
/*
OpenRat Content Management System
Copyright (C) 2002-2010 Jan Dankert
@@ -133,7 +134,7 @@ div#noticebar div.notice.ok
{
background-color: green;
}
-div#noticebar div.notice.warn
+div#noticebar div.notice.warning
{
background-color: yellow;
}
diff --git a/themes/default/include/elements.ini.php b/themes/default/include/elements.ini.php
@@ -25,7 +25,7 @@ image = config,file,url,icon,align:left,type,elementtype,fileext,tree,notice,
input = class:text,default:,type:text,index,name:*,prefix,value,size:,maxlength:256,onchange:,readonly:false,hint:,icon:
inputarea= name,rows:10,cols:40,value,index,onchange,prefix,class:inputarea,default:
insert = file,script,inline:false,url,name,function
-label = for,value,key
+label = for,value,key,text
link = title:,config,type:,target,var,url,class:,action,subaction,id,var1,value1,var2,value2,var3,value3,var4,value4,var5,value5,accesskey,name,anchor,frame:_self,modal:false
list = list:*,extract:false,key:list_key,value:list_value
logo = name:*
@@ -33,7 +33,7 @@ newline =
page = class:main,title,menu
part = id,class
password = name:*,default:,class:,size:40,maxlength:256
-radio = readonly:false,name:*,value,default:false,prefix:,suffix:,class:,onchange:,children
+radio = readonly:false,name:*,value,default:false,prefix:,suffix:,class:,onchange:,children,checked
raw =
row = class,classes,id
selectbox= list:*,name:*,default,onchange:,title:,class:,addempty:false,multiple:false,size:1,lang:false
diff --git a/themes/default/include/html/input.inc.php b/themes/default/include/html/input.inc.php
@@ -6,7 +6,7 @@
?><?php if (!$attr_readonly || $attr_type=='hidden') {
/* Feld editieren */
-?><div class="inputholder"><input<?php if ($attr_readonly) echo ' disabled="true"' ?><?php if ($attr_hint) echo ' data-hint="'.$attr_hint.'"'; ?> id="id_<?php echo $attr_name ?><?php if ($attr_readonly) echo '_disabled' ?>" name="<?php echo $attr_name ?><?php if ($attr_readonly) echo '_disabled' ?>" type="<?php echo $attr_type ?>" maxlength="<?php echo $attr_maxlength ?>" class="<?php echo str_replace(',',' ',$attr_class) ?>" value="<?php echo $tmp_value ?>" <?php if (in_array($attr_name,$errors)) echo 'style="border:2px dashed red;"' ?> /><?php if ($attr_icon) echo '<img src="'.$image_dir.'icon_'.$attr_icon.IMG_ICON_EXT.'" width="16" height="16" />'; ?></div><?php
+?><div class="<?php echo $attr_type!='hidden'?'inputholder':'inputhidden' ?>"><input<?php if ($attr_readonly) echo ' disabled="true"' ?><?php if ($attr_hint) echo ' data-hint="'.$attr_hint.'"'; ?> id="id_<?php echo $attr_name ?><?php if ($attr_readonly) echo '_disabled' ?>" name="<?php echo $attr_name ?><?php if ($attr_readonly) echo '_disabled' ?>" type="<?php echo $attr_type ?>" maxlength="<?php echo $attr_maxlength ?>" class="<?php echo str_replace(',',' ',$attr_class) ?>" value="<?php echo $tmp_value ?>" <?php if (in_array($attr_name,$errors)) echo 'style="border:2px dashed red;"' ?> /><?php if ($attr_icon) echo '<img src="'.$image_dir.'icon_'.$attr_icon.IMG_ICON_EXT.'" width="16" height="16" />'; ?></div><?php
if ($attr_readonly) {
/* Nur anzeigen */
?><input type="hidden" id="id_<?php echo $attr_name ?>" name="<?php echo $attr_name ?>" value="<?php echo $tmp_value ?>" /><?php
diff --git a/themes/default/include/html/label.inc.php b/themes/default/include/html/label.inc.php
@@ -1,2 +1,2 @@
<label<?php if (isset($attr_for)) { ?> for="id_<?php echo $attr_for ?><?php if (!empty($attr_value)) echo '_'.$attr_value ?>" class="label"<?php } ?>>
-<?php if (isset($attr_key)) { echo lang($attr_key); if(hasLang($attr_key.'_desc')) { ?><div class="description"><?php echo lang($attr_key.'_desc')?></div> <?php } } ?>-
\ No newline at end of file
+<?php if (isset($attr_key)) { echo lang($attr_key); if(hasLang($attr_key.'_desc')) { ?><div class="description"><?php echo lang($attr_key.'_desc')?></div> <?php } ?><?php if (isset($attr_text)) { echo $attr_text; } ?><?php } ?>+
\ No newline at end of file
diff --git a/themes/default/include/html/radio.inc.php b/themes/default/include/html/radio.inc.php
@@ -8,7 +8,7 @@
else
$attr_tmp_default = '';
- ?><input onclick="" class="radio" type="radio" id="id_<?php echo $attr_name.'_'.$attr_value ?>" name="<?php echo $attr_prefix.$attr_name ?>"<?php if ( $attr_readonly ) echo ' disabled="disabled"' ?> value="<?php echo $attr_value ?>"<?php if($attr_value==$attr_tmp_default||@$attr_checked) echo ' checked="checked"' ?><?php if (in_array($attr_name,$errors)) echo ' style="borderx:2px dashed red; background-color:red;"' ?> />
+ ?><input onclick="" class="radio" type="radio" id="id_<?php echo $attr_name.'_'.$attr_value ?>" name="<?php echo $attr_prefix.$attr_name ?>"<?php if ( $attr_readonly ) echo ' disabled="disabled"' ?> value="<?php echo $attr_value ?>"<?php if($attr_value==$attr_tmp_default||@$attr_checked) echo ' checked="checked"' ?> />
<?php /* #IF-ATTR deactivated-children# */ ?>
<script name="Javascript" type="text/javascript">
diff --git a/themes/default/js/openrat.js b/themes/default/js/openrat.js
@@ -465,14 +465,18 @@ function fullscreen( element ) {
function loadTree()
{
- // Oberstes Tree-Element erzeugen
- $('div#tree div.window div.content').html(" ");
- //$('div#tree div.window div.content').append('<ul class="tree"><li class="root"><div>Baum</div></li></ul>');
-
- // Wurzel des Baums laden
- //loadBranch( $('div#tree ul.tree > li'),'root',0);
- loadBranch( $('div#tree div.content'),'root',0);
- $('div#tree div.content > ul.tree > li > div.tree').delay(500).click();
+ // Nur, wenn ein Baum auch angezeigt werden soll.
+ if ( $('div#tree').attr('data-action')=='tree' )
+ {
+ // Oberstes Tree-Element erzeugen
+ $('div#tree div.window div.content').html(" ");
+ //$('div#tree div.window div.content').append('<ul class="tree"><li class="root"><div>Baum</div></li></ul>');
+
+ // Wurzel des Baums laden
+ //loadBranch( $('div#tree ul.tree > li'),'root',0);
+ loadBranch( $('div#tree div.content'),'root',0);
+ $('div#tree div.content > ul.tree > li > div.tree').delay(500).click();
+ }
}
@@ -857,8 +861,14 @@ function doResponse(data,status,element)
$(this).fadeOut('fast',function() { $(this).remove(); } );
} );
+ var timeoutSeconds;
if ( value.status == 'ok' )
- $(notice).delay(3000).fadeOut( function() { $(this).remove(); } );
+ timeoutSeconds = 2;
+ else
+ timeoutSeconds = 5;
+
+
+ $(notice).delay(timeoutSeconds*1000).fadeOut( function() { $(this).remove(); } );
/*
$('div.window div.status').html('<div />');
diff --git a/themes/default/layout/index.php b/themes/default/layout/index.php
@@ -4,7 +4,8 @@
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
- <title><?php echo OR_TITLE.' '.OR_VERSION ?></title>
+ <title><?php echo OR_TITLE.' '.OR_VERSION ?></title>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" >
<?php if ( isset($refresh_url) ) { ?>
<meta http-equiv="refresh" content="<?php echo isset($refresh_timeout)?$refresh_timeout:0 ?>; URL=<?php echo $refresh_url; if (ini_get('session.use_trans_sid')) echo '&'.session_name().'='.session_id(); ?>">
diff --git a/themes/default/layout/perspective/header.php b/themes/default/layout/perspective/header.php
@@ -9,16 +9,12 @@ function view_header( $name )
?>
-<div id="<?php echo $name ?>" data-action="<?php echo $v['action'] ?>" class="frame<?php echo ($v['refreshable']?' refreshable':'') ?><?php echo (@$v['modal']?' modal':'') ?>">
+<div id="<?php echo $name ?>" data-action="<?php echo @$v['action'] ?>" class="frame<?php echo (@$v['refreshable']?' refreshable':'') ?><?php echo (@$v['modal']?' modal':'') ?>">
<div class="window">
<div class="menu">
<div class="views">
-<!--
-<div class="backward_link"><img src="<?php echo OR_THEMES_EXT_DIR ?>default/images/icon/backward_nav.gif"/></div>
-<div class="forward_link"><img src="<?php echo OR_THEMES_EXT_DIR ?>default/images/icon/forward_nav.gif"/></div>
- -->
<ul class="views">
<?php
@@ -32,7 +28,7 @@ function view_header( $name )
$liClass = 'action'.($vn==$v['default']?' active':'');
$icon_url = OR_THEMES_EXT_DIR.'default/images/icon/'.$vn.'.png';
- ?><li title="<?php echo $tmp_text ?>" data-method="<?php echo $vn ?>" class="<?php echo $liClass?>" title="<?php echo langHtml('menu_'.$vn.'_desc'); ?>"><?php
+ ?><li data-method="<?php echo $vn ?>" class="<?php echo $liClass?>" title="<?php echo langHtml('menu_'.$vn.'_desc'); ?>"><?php
?><img class="icon" src="<?php echo $icon_url ?>" /><div class="tabname"><?php echo $tmp_text ?></div><?php
?></li><?php
}
@@ -73,23 +69,9 @@ function view_header( $name )
<!-- Hinweis-Meldungen -->
<div class="content">
- <div class="empty" />
+ <div class="empty"></div>
</div>
-<!--
-<div class="bottom">
- <div class="status">
- </div>
- <div class="command">
-
- <input type="button" class="submit" value="<?php echo lang('BUTTON_OK') ?>" onclick="$(this).closest('div.window').find('form').submit();" />
- <!-
- <input type="button" value="<?php echo lang('CANCEL') ?>" />
- ->
- </div>
-</div>
- -->
-
</div>
</div>
diff --git a/themes/default/layout/perspective/normal.php b/themes/default/layout/perspective/normal.php
@@ -1,20 +1,4 @@
-<!--
-<div id="shortcuts">
-<?php
-$icons = @$viewconfig['icons'];
-if (false&&!empty($icons))
-{
- foreach( explode(',',$icons) as $name )
- {
- echo "<div class=\"shortcut\" title=\"".lang('ACTION_'.$name)."\" onClick=\"javascript:openNewAction('".lang('ACTION_'.$name)."','$name','','');\"><img src=\"".OR_THEMES_EXT_DIR.'/default/images/icon_'.$name.'.png'."\" /></div>";
- }
-}
-?>
-
-</div>
- -->
-
<div class="bar" id="navigationbar">
<?php
view_header('tree');
@@ -38,5 +22,3 @@ view_header('side');
view_header('bottom');
?>
</div>
-
-</div>
diff --git a/themes/default/templates/pageelement/archive.tpl.src.xml b/themes/default/templates/pageelement/archive.tpl.src.xml
@@ -10,6 +10,7 @@
<if present="compareid">
<text text="GLOBAL_COMPARE"></text>
</if>
+ <else><text raw="_" /></else>
</column>
<column class="help">
<text text="DATE"></text>
@@ -43,11 +44,13 @@
<if present="compareid">
<radio name="compareid" value="var:id"></radio>
</if>
+ <else><text raw="_" /></else>
</column>
<column>
<if present="compareid">
<radio name="withid" value="var:id"></radio>
</if>
+ <else><text raw="_" /></else>
</column>
<column>
<date date="var:date"></date>
@@ -58,30 +61,30 @@
<column>
<text var="value"></text>
</column>
- <column>
+ <column class="clickable">
<if true="var:public">
<text key="GLOBAL_PUBLIC" type="strong"></text>
</if>
- <else><if present="releaseUrl"><link url="var:releaseUrl" title="message:GLOBAL_RELEASE_DESC"><text
- key="GLOBAL_RELEASE" type="strong"></text></link></if><else><text
- key="GLOBAL_INACTIVE" type="emphatic"></text></else></else>
+ <else>
+ <if present="releaseUrl">
+ <link type="open" url="var:releaseUrl" title="message:GLOBAL_RELEASE_DESC">
+ <text key="GLOBAL_RELEASE" type="strong"></text>
+ </link>
+ </if>
+ <else>
+ <text key="GLOBAL_INACTIVE" type="emphatic" />
+ </else>
+ </else>
</column>
- <column>
+ <column class="clickable">
<if true="var:active">
<text key="GLOBAL_ACTIVE" type="emphatic"></text>
</if>
- <else><if present="useUrl"><link url="var:useUrl" title="message:GLOBAL_USE_DESC"><text
- key="GLOBAL_USE"></text></link></if></else>
+ <else><if present="useUrl">
+ <link type="open" url="var:useUrl" title="message:GLOBAL_USE_DESC"><text key="GLOBAL_USE"></text></link></if></else>
</column>
</row>
</list>
</table>
- <if present="compareid">
- <row>
- <column colspan="8" class="act">
- <button type="ok"></button>
- </column>
- </row>
- </if>
</form>
</output>
\ No newline at end of file
diff --git a/themes/default/templates/user/edit.tpl.src.xml b/themes/default/templates/user/edit.tpl.src.xml
@@ -2,16 +2,14 @@
xsi:schemaLocation="http://www.openrat.de/template ../template.xsd">
<header views="remove"></header>
<form>
- <group title="message:NAME">
- <part class="line">
- <part class="label">
- <label for="name" key="user_username"></label>
- </part>
- <part class="input">
- <input name="name" size="20" class="name,focus"></input>
- </part>
+ <part class="line">
+ <part class="label">
+ <label for="name" key="user_username"></label>
</part>
- </group>
+ <part class="input">
+ <input name="name" size="20" class="name,focus"></input>
+ </part>
+ </part>
<group title="message:ADDITIONAL_INFO">
<part class="line">
<part class="label">
diff --git a/themes/default/templates/user/memberships.tpl.src.xml b/themes/default/templates/user/memberships.tpl.src.xml
@@ -1,3 +1,30 @@
-<output xmlns="http://www.openrat.de/template"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"><form><window><table><row class="headline"><column width="10%"></column><column><text key="name"></text></column></row><list list="memberships" extract="true"><row class="data"><column><checkbox name="var:var"></checkbox></column><column><label for="var:var"><image file="icon_group"></image><text var="name"></text></label></column></row></list><row><column colspan="2" class="act"><button type="ok"></button></column></row></table></window></form></output>-
\ No newline at end of file
+<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.openrat.de/template ../template.xsd">
+ <form>
+ <table>
+ <row class="headline">
+ <column colspan="2">
+ <text key="group"></text>
+ </column>
+ </row>
+ <list list="memberships" extract="true">
+ <row class="data">
+ <column width="10%">
+ <checkbox name="var:var"></checkbox>
+ </column>
+ <column>
+ <label for="var:var">
+ <image file="icon_group"></image>
+ <text var="name"></text>
+ </label>
+ </column>
+ </row>
+ </list>
+ <row>
+ <column colspan="2" class="act">
+ <button type="ok"></button>
+ </column>
+ </row>
+ </table>
+ </form>
+</output>+
\ No newline at end of file
diff --git a/themes/default/templates/user/pw.tpl.src.xml b/themes/default/templates/user/pw.tpl.src.xml
@@ -1,3 +1,71 @@
-<output xmlns="http://www.openrat.de/template"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"><form><part class="line"><part class="label"><label for="name" key="user_username"></label></part><part class="input"><text var="name" class="name"></text></part></part><group title="message:USER_new_password"></group><part class="line"><part class="label"><label for="password1" key="USER_new_password"></label></part><part class="input"><password name="password1"></password></part></part><part class="line"><part class="label"><label for="password2" key="USER_new_password_repeat"></label></part><part class="input"><password name="password2"></password></part></part><group title="message:options"></group><if present="mail"><part class="line"><part class="label"></part><part class="input"><checkbox name="email"></checkbox><label for="email" key="user_mail_new_password"></label></part></part><part class="line"><part class="label"></part><part class="input"><checkbox name="random"></checkbox><label for="random" key="user_random_password"></label></part></part><part class="line"><part class="label"></part><part class="input"><checkbox name="timeout"></checkbox><label for="timeout" key="user_password_timeout"></label></part></part></if><focus field="password1"></focus></form></output>-
\ No newline at end of file
+<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.openrat.de/template ../template.xsd">
+ <form>
+ <part class="line">
+ <part class="label"></part>
+ <part class="input">
+ <radio name="type" value="proposal"></radio>
+ <label for="type" value="proposal" text="var:password_proposal">
+ <text key="USER_new_password" />
+ <text raw="text:: " />
+ <text var="password_proposal" />
+ </label>
+ <input type="hidden" name="password_proposal" />
+ </part>
+ </part>
+
+ <if true="config:mail/enabled">
+ <part class="line">
+ <part class="label"></part>
+ <part class="input">
+ <radio name="type" value="random"></radio>
+ <label for="type" value="random" key="user_random_password"></label>
+ </part>
+ </part>
+ </if>
+ <part class="line">
+ <part class="label"></part>
+ <part class="input">
+ <radio name="type" value="input" checked="true"></radio>
+ <label for="type" value="input" key="USER_NEW_PASSWORD_INPUT">
+ </label>
+ </part>
+ </part>
+ <part class="line">
+ <part class="label">
+ <label for="password1" key="USER_new_password"></label>
+ </part>
+ <part class="input">
+ <password name="password1"></password>
+ </part>
+ </part>
+ <part class="line">
+ <part class="label">
+ <label for="password2" key="USER_new_password_repeat"></label>
+ </part>
+ <part class="input">
+ <password name="password2"></password>
+ </part>
+ </part>
+ <group title="message:options"></group>
+ <if true="config:mail/enabled">
+ <if present="mail">
+ <part class="line">
+ <part class="label"></part>
+ <part class="input">
+ <checkbox name="email"></checkbox>
+ <label for="email" key="user_mail_new_password"></label>
+ </part>
+ </part>
+ <part class="line">
+ <part class="label"></part>
+ <part class="input">
+ <checkbox name="timeout"></checkbox>
+ <label for="timeout" key="user_password_timeout"></label>
+ </part>
+ </part>
+ </if>
+ </if>
+ <focus field="password1"></focus>
+ </form>
+</output>+
\ No newline at end of file