/
delete.php
84 lines (63 loc) · 2.81 KB
/
delete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
include ('sc-app.inc');
include(APP_WEB_DIR . '/inc/header.inc');
include(APP_WEB_DIR . '/inc/role/user.inc');
use \com\indigloo\Url as Url ;
use \com\indigloo\Logger as Logger ;
use \com\indigloo\sc\auth\Login as Login ;
use com\indigloo\Constants as Constants;
use com\indigloo\ui\form\Sticky;
use com\indigloo\ui\form\Message as FormMessage;
use com\indigloo\sc\util\PseudoId as PseudoId;
$sticky = new Sticky($gWeb->find(Constants::STICKY_MAP,true));
$qUrl = Url::tryBase64QueryParam("q", "/");
$fUrl = Url::current();
$encodedId = Url::getQueryParam("id");
$commentId = PseudoId::decode($encodedId);
$commentDao = new \com\indigloo\sc\dao\Comment();
$commentDBRow = $commentDao->getOnId($commentId);
if(! (Login::isOwner($commentDBRow['login_id']) || Login::isAdmin())) {
header("Location: /site/error/403.html");
exit ;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>3mik.com - Delete a comment</title>
<?php include(APP_WEB_DIR . '/inc/meta.inc'); ?>
<?php echo \com\indigloo\sc\util\Asset::version("/css/bundle.css"); ?>
</head>
<body>
<?php include(APP_WEB_DIR . '/inc/toolbar.inc'); ?>
<div class="container mh800">
<div class="row">
<div class="span9">
<div class="page-header">
<h2> Delete Comment</h2>
</div>
<div class="alert">
<a class="close" data-dismiss="alert">×</a>
Please make sure that you really want to delete this comment.
</div>
<?php FormMessage::render(); ?>
<?php echo \com\indigloo\sc\html\Comment::getWidget($commentDBRow); ?>
<div class="p10"> </div>
<form id="web-form1" name="web-form1" action="/qa/comment/form/delete.php" method="POST">
<div>
<button class="btn btn-danger" type="submit" name="delete" value="Delete">Delete</button>
<a href="<?php echo base64_decode($qUrl); ?>" class="btn"s>Cancel</a>
</div>
<input type="hidden" name="qUrl" value="<?php echo $qUrl; ?>" />
<input type="hidden" name="fUrl" value="<?php echo $fUrl; ?>" />
<input type="hidden" name="comment_id" value="<?php echo $commentId; ?>" />
</form>
</div>
</div>
</div> <!-- container -->
<?php echo \com\indigloo\sc\util\Asset::version("/css/bundle.js"); ?>
<div id="ft">
<?php include(APP_WEB_DIR . '/inc/site-footer.inc'); ?>
</div>
</body>
</html>