MyContenido > Einstellungen

Ideen für neue Funktionen in CONTENIDO?
Antworten
OliverL
Beiträge: 870
Registriert: Do 28. Jun 2007, 09:28
Kontaktdaten:

MyContenido > Einstellungen

Beitrag von OliverL » So 14. Sep 2008, 23:38

Sollten im Bereich MyContenido > Einstellungen nicht auch die anderen Einstellungsmöglichkeiten erscheinen wie unter Administrator > Benutzer?

d.h. Telefonnummer, Strasse, Postleitzahl, Stadt, Land

mfg OliverL

emergence
Beiträge: 10641
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Mo 15. Sep 2008, 10:17

ja wäre nicht schlecht... dann könnte sich der admin das sparen...
*** make your own tools (wishlist :: thx)

OliverL
Beiträge: 870
Registriert: Do 28. Jun 2007, 09:28
Kontaktdaten:

Beitrag von OliverL » Mo 15. Sep 2008, 20:15

Hi emergence,
irgend wie habe ich das Gefühl du verfolgst mich! :lol:

Der Real-Name wird oben angezeigt und ist IMO aus Sicherheitsgründen nicht vom User änderbar.

FILE: include.mycontenido_settings.php

Code: Alles auswählen

<?php
/**
 * Project: 
 * Contenido Content Management System
 * 
 * Description: 
 * MyContenido
 * 
 * Requirements: 
 * @con_php_req 5.0
 * 
 *
 * @package    Contenido Backend includes
 * @version    1.1.3
 * @author     unknown
 * @copyright  four for business AG <www.4fb.de>
 * @license    http://www.contenido.org/license/LIZENZ.txt
 * @link       http://www.4fb.de
 * @link       http://www.contenido.org
 * @since      file available since contenido release <= 4.6
 * 
 * {@internal 
 *   created unknown
 *   modified 2008-06-27, Frederic Schneider, add security fix
 *   modified 2008-09-15, Oliver Lohkemper, add any User-Fields
 *
 *   $Id: include.mycontenido_settings.php 360 2008-09-15 21:23:50Z frederic.schneider $:
 * }}
 * 
 */

if(!defined('CON_FRAMEWORK')) {
	die('Illegal call');
}

cInclude("classes", "class.ui.php");
cInclude("classes", "widgets/class.widgets.page.php");
cInclude("classes", "contenido/class.user.php");

$user = new cApiUser($auth->auth["uid"]);

$noti = "";

if ($action == "mycontenido_editself")
{
	if (!isset($wysi))
	{
		$wysi = false;	
	}
	
	if (!isset($javaedit))
	{
		$javaedit = false;	
	}
	
	$error = false;
	
	if ($newpassword != "")
	{
    	if (md5($oldpassword) != $user->get("password"))
    	{
    		$error = i18n("Old password incorrect");	
    	}
    	
    	if (strcmp($newpassword, $newpassword2) != 0)
    	{
    		$error = i18n("Passwords don't match");
    	}
    	
    	if ($error !== false)
    	{
    		$noti = $notification->returnNotification("error", $error)."<br>";	
    	} else {
    		$user->set("password", md5($newpassword));	
    		$noti = $notification->returnNotification("info", i18n("Password changed"))."<br>";
    	}    	
	}
	

	
	$user->set("email", $email);
	$user->set("telephone", $telephone);
	$user->set("address_street", $address_street);
	$user->set("address_zip", $address_zip);
	$user->set("address_city", $address_city);
	$user->set("address_country", $address_country);
	
	$user->set("wysi", $wysi);
		
	$user->setUserProperty("backend", "timeformat", $format);
	$user->setUserProperty("backend", "timeformat_date", $formatdate);
	$user->setUserProperty("backend", "timeformat_time", $formattime);
	$user->setUserProperty("modules", "java-edit", $javaedit);  
    $user->store();
}
    
    
$settingsfor = sprintf(i18n("Settings for %s"), $user->get("username") . " (".$user->get("realname").")");

$form = new UI_Table_Form("settings");

$form->setVar("idlang", $lang);
$form->setVar("area", $area);
$form->setVar("action", "mycontenido_editself");
$form->setVar("frame", $frame);

$form->addHeader($settingsfor);

// @since 2006-07-04 Display password fields if not authenticated via LDAP/AD, only
if ($user->get("password") != 'active_directory_auth') {
	$oldpassword = new cHTMLPasswordbox("oldpassword");
	$newpassword = new cHTMLPasswordbox("newpassword");
	$newpassword2 = new cHTMLPasswordbox("newpassword2");
	
	$form->add(i18n("Old password"), $oldpassword);
	$form->add(i18n("New password"), $newpassword);
	$form->add(i18n("Confirm new password"), $newpassword2);
}

$email = new cHTMLTextbox("email", $user->get("email"),40);
$form->add(i18n("E-Mail"), $email);

$email = new cHTMLTextbox("telephone", $user->get("telephone"),40);
$form->add(i18n("Phone number"), $email);

$email = new cHTMLTextbox("address_street", $user->get("address_street"),40);
$form->add(i18n("Street"), $email);

$email = new cHTMLTextbox("address_zip", $user->get("address_zip"), 10);
$form->add(i18n("ZIP code"), $email);

$email = new cHTMLTextbox("address_city", $user->get("address_city"),40);
$form->add(i18n("City"), $email);

$email = new cHTMLTextbox("address_country", $user->get("address_country"),40);
$form->add(i18n("Country"), $email);


$wysiwyg = new cHTMLCheckbox("wysi", 1);
$wysiwyg->setChecked($user->get("wysi"));
$wysiwyg->setLabelText(i18n("Use WYSIWYG Editor"));

$javaedit = new cHTMLCheckbox("javaedit", 1);
$javaedit->setChecked($user->getUserProperty("modules", "java-edit"));
$javaedit->setLabelText(i18n("Use JAVA Module Editor (experimental)"));

$form->add(i18n("Options"), array($wysiwyg,$javaedit));

$formathint = "<br>".i18n("The format is equal to PHP's date() function.");
$formathint.= "<br>";
$formathint.= i18n("Common date formattings").":";
$formathint.= "<br>";
$formathint.= "d M Y H:i => 01 Jan 2004 00:00";
$formathint.= "<br>";
$formathint.= "d.m.Y H:i:s => 01.01.2004 00:00:00"; 

$format  = new cHTMLTextbox("format", $user->getUserProperty("backend", "timeformat"));
$format2 = new cHTMLTextbox("formatdate", $user->getUserProperty("backend", "timeformat_date"));
$format3 = new cHTMLTextbox("formattime", $user->getUserProperty("backend", "timeformat_time"));

$form->add(i18n("Date/Time format"), array($format, $formathint));
$form->add(i18n("Date format"), array($format2));
$form->add(i18n("Time format"), array($format3));
 
$page = new cPage;

$page->setContent(array($noti, $form, markSubMenuItem(3, true)));
$page->render();
?>

Antworten