Some minor corrections to avoid empty items

skala
Julio Montoya 13 years ago
parent d57c396164
commit f6914432cb
  1. 5
      main/admin/access_url_edit_users_to_url.php
  2. 3
      main/inc/lib/urlmanager.lib.php

@ -107,7 +107,6 @@ if ($_POST['form_sent']) {
} elseif (is_array($UserList)) {
$result = UrlManager::update_urls_rel_user($UserList, $access_url_id);
$url_info = UrlManager::get_url_data_from_id($access_url_id);
if (!empty($result)) {
$message .= 'URL: '.$url_info['url'].'<br />';
}
@ -118,9 +117,11 @@ if ($_POST['form_sent']) {
$user_added_list = array();
foreach($result['users_added'] as $user) {
$user_info = api_get_user_info($user);
if (!empty($user_info)) {
$user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
$i++;
}
}
if (!empty($user_added_list)) {
$message .= implode(', ', $user_added_list);
}
@ -132,9 +133,11 @@ if ($_POST['form_sent']) {
$i = 1;
foreach($result['users_deleted'] as $user) {
$user_info = api_get_user_info($user);
if (!empty($user_info)) {
$user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
$i++;
}
}
if (!empty($user_deleted_list)) {
$message .= implode(', ', $user_deleted_list);
}

@ -453,8 +453,11 @@ class UrlManager
* */
public static function delete_url_rel_user($user_id, $url_id) {
$table_url_rel_user= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$result = true;
if (!empty($user_id) && !empty($url_id)) {
$sql= "DELETE FROM $table_url_rel_user WHERE user_id = ".Database::escape_string($user_id)." AND access_url_id = ".Database::escape_string($url_id);
$result = Database::query($sql);
}
return $result;
}

Loading…
Cancel
Save