[ Index ] |
|
Code source de Dotclear 2.0-beta6 |
1 <?php 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of DotClear. 4 # Copyright (c) 2005 Olivier Meunier and contributors. All rights 5 # reserved. 6 # 7 # DotClear is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # DotClear is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 # 21 # ***** END LICENSE BLOCK ***** 22 23 require dirname(__FILE__).'/../inc/admin/prepend.php'; 24 25 dcPage::checkSuper(); 26 27 $blog_id = ''; 28 29 if (!empty($_POST['blog_id'])) 30 { 31 try { 32 $rs = $core->getBlog($_POST['blog_id']); 33 } catch (Exception $e) { 34 $core->error->add($e->getMessage()); 35 } 36 37 if ($rs->isEmpty()) { 38 $core->error->add(__('No such blog ID')); 39 } else { 40 $blog_id = $rs->blog_id; 41 } 42 } 43 44 # Delete the blog 45 if (!$core->error->flag() && $blog_id && !empty($_POST['del'])) 46 { 47 if (!$core->auth->checkPassword(crypt::hmac(DC_MASTER_KEY,$_POST['pwd']))) { 48 $core->error->add(__('Password verification failed')); 49 } else { 50 try { 51 $core->delBlog($blog_id); 52 http::redirect('blogs.php?del=1'); 53 } catch (Exception $e) { 54 $core->error->add($e->getMessage()); 55 } 56 } 57 } 58 59 dcPage::open('Delete a blog'); 60 61 if (!$core->error->flag()) 62 { 63 echo 64 '<h2>'.__('Delete a blog').'</h2>'. 65 '<p class="message">'.__('Warning').'</p>'. 66 '<p>'.sprintf(__('You are about to delete the blog %s. Every entry, comment and category will be deleted.'), 67 '<strong>'.$blog_id.'</strong>').'</p>'. 68 '<p>'.__('Please give your password to confirm the blog deletion.').'</p>'; 69 70 echo 71 '<form action="blog_del.php" method="post">'. 72 '<p><label>'.__('Your password:').' '. 73 form::password('pwd',20,255).'</label></p>'. 74 '<p><input type="submit" name="del" value="'.__('Delete this blog').'" />'. 75 form::hidden('blog_id',$blog_id).'</p>'. 76 '</form>'; 77 } 78 79 dcPage::close(); 80 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Feb 23 22:16:06 2007 | par Balluche grâce à PHPXref 0.7 |