diff options
author | till <till@php.net> | 2008-02-10 17:08:40 +0000 |
---|---|---|
committer | till <till@php.net> | 2008-02-10 17:08:40 +0000 |
commit | e3a0af34d52c41fc2f45522528e484f858f1ce3e (patch) | |
tree | 15f196a0e84ad8838474998291f580fbcd839e70 /program/include/rcube_user.inc | |
parent | 56c4587f0aef450a3a64194cd09b0d3c2913bc18 (diff) |
* fixing #1484494 (people can delete the last identity otherwise)
* FOR TRANSLATERS: introducing new message
Diffstat (limited to 'program/include/rcube_user.inc')
-rw-r--r-- | program/include/rcube_user.inc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/program/include/rcube_user.inc b/program/include/rcube_user.inc index 841c84341..20c8dd827 100644 --- a/program/include/rcube_user.inc +++ b/program/include/rcube_user.inc @@ -241,6 +241,15 @@ class rcube_user 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')." |