More tweaks to the new delete user option.

This commit is contained in:
Andrew McMillan 2009-09-25 14:41:32 +12:00
parent 8e8fc02934
commit 1335d2008e
2 changed files with 6 additions and 3 deletions

View File

@ -10,6 +10,9 @@
$user_no = intval(isset($_POST['user_no']) ? $_POST['user_no'] : (isset($_GET['user_no'])?$_GET['user_no']:0) );
$user = new DAViCalUser($user_no);
if ( 'insert' == $user->WriteType && $user->user_no > 0 ) {
$user = new DAViCalUser(0);
}
if ( $user->user_no == 0 ) {
$c->page_title = ( $user_no != "" ? translate("User Unavailable") : translate("New User") );
}
@ -53,7 +56,7 @@
if ( $user->user_no > 0 ) {
if ( $user->AllowedTo('update') && ! $user->EditMode ) {
$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 );
$user_menu->AddOption( sprintf(translate("Edit %s"), $user->Get('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->Get('fullname')), "$c->base_url/usr.php?user_no=$user->user_no", translate("View this user record"), true, 900 );

View File

@ -66,7 +66,7 @@ class DAViCalUser extends User
if ( isset($this->delete_user_confirmation_required) ) {
$html .= '<p class="error">';
$html .= sprintf('<b>User:</b> %s: <a class="error" href="%s&%s">%s</a>', $this->Get('username'), $_SERVER['REQUEST_URI'], $this->delete_user_confirmation_required, translate('Confirm Deletion of the User') );
$html .= sprintf('<b>%s</b> \'%s\' <a class="error" href="%s&%s">%s</a> %s', translate('Deleting User:'), $this->Get('username'), $_SERVER['REQUEST_URI'], $this->delete_user_confirmation_required, translate('Confirm Deletion of the User'), translate('All of the user\'s calendars and events will be unrecoverably deleted.') );
$html .= "</p>\n";
}
@ -289,7 +289,7 @@ EOSQL;
$html = ( $title == '' ? '' : $ef->BreakLine(translate($title)) );
if ( isset($this->delete_collection_confirmation_required) ) {
$html .= '<tr><td colspan="2" class="error">';
$html .= sprintf('<b>Collection:</b> %s: <a class="error" href="%s&%s">%s</a>', $_GET['dav_name'], $_SERVER['REQUEST_URI'], $this->delete_collection_confirmation_required, translate('Confirm Deletion of the Collection') );
$html .= sprintf('<b>%s</b> "%s" <a class="error" href="%s&%s">%s</a> %s', translate('Deleting Collection:'), $_GET['dav_name'], $_SERVER['REQUEST_URI'], $this->delete_collection_confirmation_required, translate('Confirm Deletion of the Collection'), translate('All collection data will be unrecoverably deleted.') );
$html .= "</td></tr>\n";
}
$html .= '<tr><td colspan="2">';