Source for file delavatar.php
Documentation is available at delavatar.php
* @package linea21.modules
* @author Simon Georget <simon@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
include_once('../config/define.php');
include_once('../admin/'. SQL. '.inc.php');
$id= $_GET['id']; // we retrieve given id
// we get current user id from DB
if ($data != 0 && count($data) == 1) {
if(!isset ($_GET['mode'])) {
//////////// Check Droits utilisateur ////////////
include_once('../languages/' . U_L . '/lang_user.' . CHARSET . '.php');
// include_once('../languages/' . U_L . '/lang_common.' . CHARSET . '.php');
include_once('../class/class.user.php');
$r = $user->deleteAvatar($id, $GLOBALS['sql_object']);
$link_confirm = SITE_ROOT_URL. "admin/confirm.php?rub=user&todo=delavatar&id=". $id;
if($r) header("Location: ". $link_confirm);
if(!$r) system_error(__FUNCTION__ . ' : SQL error when deleting avatar for user ' . $id);
$o = _t('user', 'confirm_delavatar');
echo json_encode(array('status'=> $status,'msg'=> $o));
|