| | |
| | | |
| | | */ |
| | | |
| | | $cid = get_input_value('_cid', RCUBE_INPUT_POST); |
| | | $return_action = empty($cid) ? 'add' : 'show'; |
| | | |
| | | // check request token and exit if invalid |
| | | if (!$RCMAIL->check_request('save.'.intval($cid), RCUBE_INPUT_POST)) |
| | | { |
| | | $OUTPUT->show_message('invalidrequest', 'error'); |
| | | rcmail_overwrite_action($return_action); |
| | | return; |
| | | } |
| | | |
| | | // cannot edit record |
| | | if ($CONTACTS->readonly) |
| | | { |
| | | $OUTPUT->show_message('contactreadonly', 'error'); |
| | | rcmail_overwrite_action(empty($_POST['_cid']) ? 'add' : 'show'); |
| | | rcmail_overwrite_action($return_action); |
| | | return; |
| | | } |
| | | |
| | |
| | | if ((!get_input_value('_name', RCUBE_INPUT_POST) || !get_input_value('_email', RCUBE_INPUT_POST))) |
| | | { |
| | | $OUTPUT->show_message('formincomplete', 'warning'); |
| | | rcmail_overwrite_action(empty($_POST['_cid']) ? 'add' : 'show'); |
| | | rcmail_overwrite_action($return_action); |
| | | return; |
| | | } |
| | | |
| | |
| | | // setup some vars we need |
| | | $a_save_cols = array('name', 'firstname', 'surname', 'email'); |
| | | $a_record = array(); |
| | | $cid = get_input_value('_cid', RCUBE_INPUT_POST); |
| | | |
| | | // read POST values into hash array |
| | | foreach ($a_save_cols as $col) |