till
2008-02-10 e3a0af34d52c41fc2f45522528e484f858f1ce3e
* fixing #1484494 (people can delete the last identity otherwise)
* FOR TRANSLATERS: introducing new message



5 files modified
22 ■■■■ changed files
program/include/rcube_user.inc 9 ●●●●● patch | view | raw | blame | history
program/localization/de_DE/messages.inc 2 ●●● patch | view | raw | blame | history
program/localization/en_GB/messages.inc 2 ●●● patch | view | raw | blame | history
program/localization/en_US/messages.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/delete_identity.inc 7 ●●●● patch | view | raw | blame | history
program/include/rcube_user.inc
@@ -241,6 +241,15 @@
    
    if (!$this->ID)
      return false;
    $sql_result = $DB->query("SELECT count(*) AS ident_count FROM " .
      get_table_name('identities') .
      " WHERE user_id = ? AND del != 1",
      $this->ID);
    $sql_arr = $DB->fetch_assoc($sql_result);
    if ($sql_arr['ident_count'] <= 1)
      return false;
    
    $DB->query(
      "UPDATE ".get_table_name('identities')."
program/localization/de_DE/messages.inc
@@ -76,5 +76,5 @@
$messages['movingmessage'] = 'Die E-Mail wird verschoben...';
$messages['receiptsent'] = 'Bestätigung erfolgreich gesendet';
$messages['errorsendingreceipt'] = 'Bestätigung konnte nicht gesendet werden';
$messages['nodeletelastidentity'] = 'Sie koennen diesen Absender nicht loeschen.';
?>
program/localization/en_GB/messages.inc
@@ -74,5 +74,5 @@
$messages['sourceisreadonly'] = 'This address source is read-only';
$messages['errorsavingcontact'] = 'Could not save the contact address';
$messages['movingmessage'] = 'Moving message...';
$messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
?>
program/localization/en_US/messages.inc
@@ -76,5 +76,5 @@
$messages['movingmessage'] = 'Moving message...';
$messages['receiptsent'] = 'Successfully sent a read receipt';
$messages['errorsendingreceipt'] = 'Could not send the receipt';
$messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
?>
program/steps/settings/delete_identity.inc
@@ -23,8 +23,13 @@
{
  if ($USER->delete_identity($ids))
  {
    $OUTPUT->show_message('deletedsuccessfully', 'confirmation');
  }
  else
  {
    $OUTPUT->show_message('nodeletelastidentity', 'error');
  }
  // send response
  if ($OUTPUT->ajax_call)
    $OUTPUT->send();