diff --git a/htdocs/usr.php b/htdocs/usr.php
index 3db41adf..41655800 100644
--- a/htdocs/usr.php
+++ b/htdocs/usr.php
@@ -35,35 +35,6 @@
$c->page_title = $user->Get("user_no"). " - " . $user->Get("fullname");
}
}
- if ( $_FILES['ics_file']['name'] && $_POST['path_ics'] ) {
- $ics = file_get_contents($_FILES['ics_file']['tmp_name']);
- $ics = trim($ics);
- $path_ics = $_POST['path_ics'];
-
- if ( substr($path_ics,-1,1) != '/' ) $path_ics .= '/'; // ensure that we target a collection
- if ( substr($path_ics,0,1) != '/' ) $path_ics = '/'.$path_ics; // ensure that we target a collection
-
- if ( $ics !='' ) {
- /**
- * If the user has uploaded a .ics file as a calendar, we fake this out
- * as if it were a "PUT" request against a collection. This is something
- * of a hack. It works though :-)
- */
- include('check_UTF8.php');
- if ( check_string($ics) ) {
- $path = "/".$user->Get("username").$path_ics;
- include("caldav-PUT-functions.php");
- if(controlRequestContainer($user->Get("username"),$user->user_no, $path,false) === true ){
- import_collection($ics,$user->user_no,$path,$session->user_no);
- $c->messages[] = sprintf(translate("All events of user %s were deleted and replaced by those from the file."),$user->Get("username"));
- }
- } else
- $c->messages[] = sprintf(translate("The file %s is not UTF-8 encoded, please check the error for more details."),$dir.'/'.$file);
- }
- }
- else {
- unset($ics);
- }
}
else {
/**
@@ -85,7 +56,7 @@
$user_menu->AddOption( sprintf(translate("Edit %s"), $user->Values->fullname), "$c->base_url/usr.php?user_no=$user->user_no&edit=1", translate("Edit this user record"), true, 900 );
}
else {
- $user_menu->AddOption( sprintf(translate("View %s"), $user->Values->fullname), "$c->base_url/usr.php?user_no=$user->user_no", translate("View this user record"), true, 900 );
+ $user_menu->AddOption( sprintf(translate("View %s"), $user->Get('fullname')), "$c->base_url/usr.php?user_no=$user->user_no", translate("View this user record"), true, 900 );
}
}
diff --git a/inc/DAViCalUser.php b/inc/DAViCalUser.php
index a52b7d47..41b8f1df 100644
--- a/inc/DAViCalUser.php
+++ b/inc/DAViCalUser.php
@@ -9,12 +9,14 @@
* @license http://gnu.org/copyleft/gpl.html GNU GPL v2
*/
-require("User.php");
-require_once("classBrowser.php");
-require_once("auth-functions.php");
+include('User.php');
+include('classBrowser.php');
+include('auth-functions.php');
+include('check_UTF8.php');
+include('caldav-PUT-functions.php');
-$c->stylesheets[] = "$c->base_url/css/browse.css";
-$c->scripts[] = "$c->base_url/js/browse.js";
+$c->stylesheets[] = $c->base_url.'/css/browse.css';
+$c->scripts[] = $c->base_url.'/js/browse.js';
/**
* A class for viewing and maintaining DAViCal User records
@@ -25,13 +27,15 @@ class DAViCalUser extends User
{
var $delete_collection_confirmation_required;
+ var $delete_user_confirmation_required;
/**
* Constructor - nothing fancy as yet.
*/
- function DAViCalUser( $id , $prefix = "") {
+ function DAViCalUser( $id , $prefix = '') {
global $c;
$this->delete_collection_confirmation_required = null;
+ $this->delete_user_confirmation_required = null;
parent::User( $id, $prefix );
if ( $this->user_no == 0 && isset($c->template_usr) && is_array($c->template_usr) ) {
foreach( $c->template_usr AS $k => $v ) {
@@ -44,40 +48,50 @@ class DAViCalUser extends User
* Render the form / viewer as HTML to show the user
* @return string An HTML fragment to display in the page.
*/
- function Render($title = "" ) {
+ function Render($title = '' ) {
global $c;
- $html = "";
- dbg_error_log("User", ":Render: type=$this->WriteType, edit_mode=$this->EditMode" );
+ $html = '';
+ dbg_error_log('User', ":Render: type=$this->WriteType, edit_mode=$this->EditMode" );
$ef = new EntryForm( $_SERVER['REQUEST_URI'], $this->Values, $this->EditMode );
$ef->NoHelp(); // Prefer this style, for the moment
$html = '
';
- $html .= sprintf("
%s
\n", translate("You are ".($ef->EditMode?"editing":"viewing"))." ".translate($title));
+ $html .= sprintf('
\n", '#even' );
$browser->SetTranslatable( array('rt_name') );
$browser->DoQuery();
/**
* Present an extra editable row at the bottom of the browse.
*/
- if ( $ef->EditMode ) { // && $session->AllowedTo("MaintainRelationships") ) {
+ if ( $ef->EditMode ) {
if ( isset($this->roles['Group']) ) {
/**
* We only allow individuals to link to groups at this stage.
@@ -214,28 +205,28 @@ SELECT user_no, fullname FROM usr
EOSQL;
if ( ! isset($this->roles['Group']) )
- $nullvalue = translate( "--- select a user, group or resource ---" );
+ $nullvalue = translate( '--- select a user, group or resource ---' );
else
- $nullvalue = translate( "--- select a user or resource ---" );
- $person_selection = $ef->DataEntryField( "", "lookup", "relate_to",
- array("title" => translate("Select the user, resource or group to relate this user to"),
- "_null" => $nullvalue,
- "_sql" => $sql ) );
+ $nullvalue = translate( '--- select a user or resource ---' );
+ $person_selection = $ef->DataEntryField( '', 'lookup', 'relate_to',
+ array('title' => translate('Select the user, resource or group to relate this user to'),
+ '_null' => $nullvalue,
+ '_sql' => $sql ) );
- $relationship_type_selection = $ef->DataEntryField( "", "lookup", "relate_as",
- array("title" => translate("Select the type of relationship from this user"),
- "_null" => translate("--- select a relationship type ---"),
- "_sql" => "SELECT rt_id, rt_name FROM relationship_type " ) );
+ $relationship_type_selection = $ef->DataEntryField( '', 'lookup', 'relate_as',
+ array('title' => translate('Select the type of relationship from this user'),
+ '_null' => translate('--- select a relationship type ---'),
+ '_sql' => 'SELECT rt_id, rt_name FROM relationship_type ' ) );
$browser->AddRow( array(
'user_link' => $person_selection,
'rt_name' => $relationship_type_selection, /* Since 'fullname' is formatted to display this value */
- 'delete' => sprintf('', htmlspecialchars(translate("Add Relationship")))
+ 'delete' => sprintf('', htmlspecialchars(translate('Add Relationship')))
) );
}
- $html = ( $title == "" ? "" : $ef->BreakLine(translate($title)) );
- $html .= "