Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120836747
delete.inc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
delete.inc
View Options
<
?
php
/*
+-----------------------------------------------------------------------+
| program/steps/addressbook/delete.inc |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2009, The Roundcube Dev Team |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Delete the submitted contacts (CIDs) from the users address book |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
if
(
$
OUTPUT
-
>
ajax_call
&&
(
$
cid
=
get_input_value
(
'
_cid
'
,
RCUBE_INPUT_POST
))
&&
preg_match
(
'
/
^
[
a
-
zA
-
Z0
-
9
\
+
\
/=
_
-
]
+
(,[
a
-
zA
-
Z0
-
9
\
+
\
/=
_
-
]
+
)
*
$
/
'
,
$
cid
)
)
{
$
plugin
=
$
RCMAIL
-
>
plugins
-
>
exec_hook
(
'
contact_delete
'
,
array
(
'
id
'
=
>
$
cid
,
'
source
'
=
>
get_input_value
(
'
_source
'
,
RCUBE_INPUT_GPC
)));
$
deleted
=
!$
plugin
[
'
abort
'
]
?
$
CONTACTS
-
>
delete
(
$
cid
)
:
$
plugin
[
'
result
'
];
if
(
!$
deleted
)
{
$
OUTPUT
-
>
show_message
(
$
plugin
[
'
message
'
]
?
$
plugin
[
'
message
'
]
:
'
contactdelerror
'
,
'
error
'
);
$
OUTPUT
-
>
command
(
'
list_contacts
'
);
}
else
{
$
OUTPUT
-
>
show_message
(
'
contactdeleted
'
,
'
confirmation
'
);
// count contacts for this user
$
result
=
$
CONTACTS
-
>
count
();
// update saved search after data changed
if
((
$
search_request
=
$
_REQUEST
[
'
_search
'
])
&&
isset
(
$
_SESSION
[
'
search
'
][
$
search_request
]))
$
_SESSION
[
'
search
'
][
$
search_request
]
=
$
CONTACTS
-
>
refresh_search
();
// update message count display
$
OUTPUT
-
>
set_env
(
'
pagecount
'
,
ceil
(
$
result
-
>
count
/
$
CONTACTS
-
>
page_size
));
$
OUTPUT
-
>
command
(
'
set_rowcount
'
,
rcmail_get_rowcount_text
(
$
result
-
>
count
));
// add new rows from next page (if any)
$
pages
=
ceil
((
$
result
-
>
count
+
$
deleted
)
/
$
CONTACTS
-
>
page_size
);
if
(
$
_GET
[
'
_from
'
]
!
=
'
show
'
&&
$
pages
>
1
&&
$
CONTACTS
-
>
list_page
<
$
pages
)
rcmail_js_contacts_list
(
$
CONTACTS
-
>
list_records
(
null
,
-
$
deleted
));
}
// send response
$
OUTPUT
-
>
send
();
}
exit
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 1:35 PM (5 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18863127
Default Alt Text
delete.inc (2 KB)
Attached To
Mode
R113 roundcubemail
Attached
Detach File
Event Timeline