$clib = isset($_REQUEST['clib']) ? $_REQUEST['clib'] : (isset($_REQUEST['ilibs']) ? $_REQUEST['ilibs'] : $cfg['ilibs'][0]['value']); // set current file $cfile = isset($_REQUEST['cfile']) ? $_REQUEST['cfile'] : ''; // set new file $nfile = isset($_REQUEST['nfile']) ? $_REQUEST['nfile'] : ''; // set list view $list = isset($_REQUEST['flist']) ? $_REQUEST['flist'] : $cfg['list']; $list = false; //------------------------------------------------------------------------- // file/directory actions if ($param[0] == 'delete') { // ACTION: delete image $action = $param[0]; $cfile = $param[1]; // current filename if (!deleteImg($clib, $cfile)) { echo $l->m('er_001') . ': ' . $l->m('er_030'); } } else { if ($param[0] == 'rename') { // ACTION: rename image $action = $param[0]; $cfile = $param[1]; // current filename $nfile = $param[2]; // new filename if (!($nfile = renameImg($clib, $cfile, $nfile))) { echo $l->m('er_001') . ': ' . $l->m('er_033'); } } else { if ($param[0] == 'upload') {
array_walk($spaw_imglibs, 'is_array_value', $imglib); if (!$value_found || empty($imglib)) { $imglib = $spaw_imglibs[0]['value']; } $lib_options = liboptions($spaw_imglibs, '', $imglib); $img = isset($HTTP_POST_VARS['imglist']) ? $HTTP_POST_VARS['imglist'] : ''; $preview = ''; $errors = array(); if (isset($HTTP_POST_FILES['img_file']['size']) && $HTTP_POST_FILES['img_file']['size'] > 0) { if ($img = uploadImg('img_file')) { $preview = $spaw_base_url . $imglib . $img; } } // delete if ($spaw_img_delete_allowed && isset($HTTP_POST_VARS['lib_action']) && $HTTP_POST_VARS['lib_action'] == 'delete' && !empty($img)) { deleteImg(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title><?php echo $l->m('title'); ?> </title> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $l->getCharset(); ?> ">
function deleteImg($shorten, $api_key) { if (isUrlOwned($shorten, $api_key)) { deleteImage($shorten); } else { echo "Error"; } } $__ROOT__ = dirname(__FILE__) . "/.."; require_once $__ROOT__ . "/lib/lib.php"; if (!isset($_SESSION)) { session_start(); } if (!isset($_GET["d"]) && !isset($_GET["dm"])) { header("Location: .."); die; } $db = getConnexion(); if ($db) { if (isset($_GET["d"])) { deleteImg($_GET["d"], $_SESSION["api"]); } else { $images = json_decode($_GET["dm"]); foreach ($images as $img) { deleteImg($img, $_SESSION["api"]); } } header("Location: .."); die; }
public function deleteUserAvatar($uid) { $types = array('s' => 'small', 'm' => 'middle', 'b' => 'big'); $avatar_path = $this->getUserAvatarPath($uid); foreach ($types as $type) { deleteImg($avatar_path['path'] . '_' . $type . '.jpg'); } }
if (isset($_POST['imglist'])) { $img_params = explode(SPAW_VSEP, $_POST['imglist']); $img = basename($img_params[1]); } $preview = ''; $errors = array(); if (isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) { $img = uploadImg('img_file', $cur_imglib); } // delete confirm if ($cur_imglib['delete_allowed'] && isset($_POST['lib_action']) && $_POST['lib_action'] == 'delete' && !empty($img)) { deleteConfirm($cur_imglib); } // delete if ($cur_imglib['delete_allowed'] && isset($_POST['lib_action']) && $_POST['lib_action'] == 'dodelete' && !empty($img)) { deleteImg($cur_imglib, $img); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $l->getCharset(); ?> "> <title><?php echo $l->m('title'); ?> </title> <link rel="stylesheet" type="text/css" href="<?php