| 1 |
<?php |
<?php |
| 2 |
// $Id: bookmarks2.module,v 1.8.4.5 2008/08/05 12:49:31 sanduhrs Exp $ |
// $Id: bookmarks2.module,v 1.8.4.6 2008/08/05 13:02:41 sanduhrs Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Bookmarks2 |
* Bookmarks2 |
| 275 |
/** |
/** |
| 276 |
* Confirmation screen to make sure user really wants to delete their bookmark |
* Confirmation screen to make sure user really wants to delete their bookmark |
| 277 |
*/ |
*/ |
| 278 |
function bookmarks2_delete_confirm(&$form_state = null, $url = NULL, $uid = NULL) { |
function bookmarks2_delete_confirm($url = NULL, $uid = NULL) { |
| 279 |
if (!$url) { |
if (!$url) { |
| 280 |
$url = check_plain($_GET['url']); |
$url = check_plain($_GET['url']); |
| 281 |
} |
} |
| 293 |
function bookmarks2_delete_confirm_submit($form_id, $form_values) { |
function bookmarks2_delete_confirm_submit($form_id, $form_values) { |
| 294 |
global $user; |
global $user; |
| 295 |
|
|
| 296 |
db_query("DELETE FROM {bookmarks2} WHERE uid = %d AND url = '%s'", $user->uid, $form_state['values']['url']); |
db_query("DELETE FROM {bookmarks2} WHERE uid = %d AND url = '%s'", $user->uid, $form_values['url']); |
| 297 |
drupal_set_message(t('Deleted bookmark.')); |
drupal_set_message(t('Deleted bookmark.')); |
| 298 |
|
|
| 299 |
drupal_goto('bookmarks2'); |
drupal_goto('bookmarks2'); |
| 471 |
/** |
/** |
| 472 |
* Form validation |
* Form validation |
| 473 |
*/ |
*/ |
| 474 |
function bookmarks2_form_validate($form, &$form_state) { |
function bookmarks2_form_validate($form, &$form_values) { |
| 475 |
if ((isset($form_state['values']['pword']) && $form_state['values']['pword'] == '') && (!isset($form_state['values']['key']) || !$form_state['values']['key'])) { |
if ((isset($form_values['pword']) && $form_values['pword'] == '') && (!isset($form_values['key']) || !$form_values['key'])) { |
| 476 |
form_set_error('pword', t('You must supply your bookmark reminder key to encrypt the password for your login reminder.')); |
form_set_error('pword', t('You must supply your bookmark reminder key to encrypt the password for your login reminder.')); |
| 477 |
} |
} |
| 478 |
elseif ($form_state['values']['key'] && !_bookmarks2_check_key($form_state['values']['key'])) { |
elseif ($form_values['key'] && !_bookmarks2_check_key($form_values['key'])) { |
| 479 |
form_set_error('key', t('The reminder key you supplied does not match the one on record.')); |
form_set_error('key', t('The reminder key you supplied does not match the one on record.')); |
| 480 |
} |
} |
| 481 |
} |
} |