aboutsummaryrefslogtreecommitdiff
path: root/h-source
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2010-11-02 12:40:21 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2010-11-02 12:40:21 +0000
commit4daafefd0c29440c6fbad2239be2803ad04b92cd (patch)
tree05015ae5c876c7cc60ccca207f21e398ce99b5f2 /h-source
parent049e37619a1ea7de4eed2695139645d6d6b9f397 (diff)
moderators can block/unblock users - part 2
Diffstat (limited to 'h-source')
-rw-r--r--h-source/Application/Controllers/GenericController.php12
-rw-r--r--h-source/Application/Controllers/HistoryController.php46
-rw-r--r--h-source/Application/Controllers/IssuesController.php5
-rw-r--r--h-source/Application/Controllers/MyController.php3
-rw-r--r--h-source/Application/Views/Help/index.php53
-rw-r--r--h-source/Application/Views/Help/index_es.php54
-rw-r--r--h-source/Application/Views/Help/index_fr.php53
-rw-r--r--h-source/Application/Views/Help/index_it.php54
-rw-r--r--h-source/Application/Views/My/panel.php6
9 files changed, 262 insertions, 24 deletions
diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php
index f29f01d..57b22ec 100644
--- a/h-source/Application/Controllers/GenericController.php
+++ b/h-source/Application/Controllers/GenericController.php
@@ -30,6 +30,8 @@ class GenericController extends BaseController
public function __construct($model, $controller, $queryString) {
parent::__construct($model, $controller, $queryString);
+ $this->model('UsersModel');
+
$popup = new Popup();
$popup->name = gtext('sort by');
switch ($this->controller)
@@ -67,6 +69,8 @@ class GenericController extends BaseController
{
if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..');
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..');
+
if (isset($_POST['insertAction']))
{
if ($this->checkDist())
@@ -127,6 +131,8 @@ class GenericController extends BaseController
{
if (!$this->s['registered']->checkCsrf($clean['token'])) die("wrong token");
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) die("your account has been blocked");
+
$clean['id_user'] = (int)$this->s['registered']->status['id_user'];
$clean['id_hard'] = $this->request->post('id_hard',0,'forceInt');
@@ -190,6 +196,8 @@ class GenericController extends BaseController
{
if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..');
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..');
+
$deleted = $this->m['HardwareModel']->select("hardware.deleted")->where(array("id_hard"=>$clean['id_hard']))->limit(1)->toList('deleted')->send();
if (strcmp($deleted[0],'no') === 0)
@@ -575,6 +583,8 @@ class GenericController extends BaseController
{
if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..');
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..');
+
if (isset($_POST['confirmAction']))
{
if (strcmp($deleted[0],'no') === 0)
@@ -622,6 +632,8 @@ class GenericController extends BaseController
{
if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..');
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..');
+
$this->m['TalkModel']->values['created_by'] = $this->s['registered']->status['id_user'];
$this->m['TalkModel']->values['id_hard'] = $clean['id_hard'];
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php
index 7702ac9..997878b 100644
--- a/h-source/Application/Controllers/HistoryController.php
+++ b/h-source/Application/Controllers/HistoryController.php
@@ -106,6 +106,7 @@ class HistoryController extends BaseController
parent::__construct($model, $controller, $queryString);
$this->model('HistoryModel');
+ $this->model('UsersModel');
}
@@ -145,6 +146,8 @@ class HistoryController extends BaseController
{
if (!$this->s['registered']->checkCsrf($clean['token'])) die("wrong token");
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) die("your account has been blocked");
+
$clean['id_user'] = (int)$this->s['registered']->status['id_user'];
$clean['id'] = $this->request->post('id',0,'forceInt');
$type = $this->request->post('type',0,'sanitizeAll');
@@ -216,28 +219,31 @@ class HistoryController extends BaseController
{
if ($this->ismoderator)
{
- $clean['id'] = (int)$id;
- if (array_key_exists($type,$this->types))
+ if (!$this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user']))
{
- $clean['type'] = $this->types[$type]['clean_type'];
-
- switch ($clean['type']) {
- case 'user':
- $data['object'] = 'user';
- $data['box_class'] = 'details_of_actions_inner_user';
- break;
- default:
- $data['object'] = 'message';
- $data['box_class'] = 'details_of_actions_inner';
- break;
+ $clean['id'] = (int)$id;
+ if (array_key_exists($type,$this->types))
+ {
+ $clean['type'] = $this->types[$type]['clean_type'];
+
+ switch ($clean['type']) {
+ case 'user':
+ $data['object'] = 'user';
+ $data['box_class'] = 'details_of_actions_inner_user';
+ break;
+ default:
+ $data['object'] = 'message';
+ $data['box_class'] = 'details_of_actions_inner';
+ break;
+ }
+
+ $data['res'] = $this->m['HistoryModel']->select()->where(array('id'=>$clean['id'],'type'=>$clean['type']))->send();
+
+ $data['md_action'] = array('hide'=>'hidden','show'=>'restored','block'=>'blocked','unblock'=>'un-blocked');
+
+ $this->append($data);
+ $this->load('viewall');
}
-
- $data['res'] = $this->m['HistoryModel']->select()->where(array('id'=>$clean['id'],'type'=>$clean['type']))->send();
-
- $data['md_action'] = array('hide'=>'hidden','show'=>'restored','block'=>'blocked','unblock'=>'un-blocked');
-
- $this->append($data);
- $this->load('viewall');
}
}
}
diff --git a/h-source/Application/Controllers/IssuesController.php b/h-source/Application/Controllers/IssuesController.php
index 86fc49c..efda83e 100644
--- a/h-source/Application/Controllers/IssuesController.php
+++ b/h-source/Application/Controllers/IssuesController.php
@@ -32,6 +32,7 @@ class IssuesController extends BaseController
$this->model('IssuesModel');
$this->model('MessagesModel');
+ $this->model('UsersModel');
$argKeys = array(
'page:forceNat' => 1,
@@ -58,6 +59,8 @@ class IssuesController extends BaseController
{
if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect('home/index'.$this->lang,2,'wrong token..');
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..');
+
//set the page to 1 in the viewStatus
$this->viewArgs['page'] = 1;
$this->buildStatus();
@@ -125,6 +128,8 @@ class IssuesController extends BaseController
{
if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect('home/index'.$this->lang,2,'wrong token..');
+ if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..');
+
$this->m['MessagesModel']->values['created_by'] = (int)$this->s['registered']->status['id_user'];
$this->m['MessagesModel']->values['id_issue'] = $clean['id_issue'];
$this->m['MessagesModel']->updateTable('insert');
diff --git a/h-source/Application/Controllers/MyController.php b/h-source/Application/Controllers/MyController.php
index 07c6190..c2b715f 100644
--- a/h-source/Application/Controllers/MyController.php
+++ b/h-source/Application/Controllers/MyController.php
@@ -46,9 +46,12 @@ class MyController extends BaseController
$data['title'] = 'my panel - '.Website::$generalName;
$this->s['registered']->check();
+
$clean['id_user'] = (int)$this->s['registered']->status['id_user'];
$data['username'] = $this->m['UsersModel']->getUser($clean['id_user']);
+ $data['isBlocked'] = $this->m['UsersModel']->isBlocked($clean['id_user']);
+
$this->append($data);
$this->load('panel');
$this->right($this->lang);
diff --git a/h-source/Application/Views/Help/index.php b/h-source/Application/Views/Help/index.php
index c7c0bb9..7929cbe 100644
--- a/h-source/Application/Views/Help/index.php
+++ b/h-source/Application/Views/Help/index.php
@@ -40,7 +40,7 @@
<h3>List of <?php echo Website::$generalName;?> wiki tags</h3>
- <table class="help_wiki_table" width="100%">
+ <table class="help_wiki_table" width="100%" border="1px">
<thead>
<tr>
<th>name</th>
@@ -153,6 +153,57 @@
</tr>
</table>
+ <h3>Some more examples:</h3>
+
+ <table width="100%" border="1px">
+ <tr>
+ <td>
+ <b>List</b>
+ </td>
+ <td>
+ <ul>
+ <li>first item</li>
+ <li>second item</li>
+ </ul>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[list]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]first item[/*]</li>
+ <li>[*]second item[/*]</li>
+ </ul>
+ </li>
+ <li>[/list]</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Numbered list</b>
+ </td>
+ <td>
+ <ol>
+ <li>first item</li>
+ <li>second item</li>
+ </ol>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[enum]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]first item[/*]</li>
+ <li>[*]second item[/*]</li>
+ </ul>
+ </li>
+ <li>[/enum]</li>
+ </ul>
+ </td>
+ </tr>
+ </table>
+
<a name="compatibility"><h1>Compatibility classes</h1></a>
<a name="notebook-compatibility"><h2>Notebooks</h2></a>
diff --git a/h-source/Application/Views/Help/index_es.php b/h-source/Application/Views/Help/index_es.php
index 5ecc7f0..bf19b5b 100644
--- a/h-source/Application/Views/Help/index_es.php
+++ b/h-source/Application/Views/Help/index_es.php
@@ -40,7 +40,7 @@
<h3>Lista de las etiquetas wiki de <?php echo Website::$generalName;?></h3>
- <table class="help_wiki_table" width="100%">
+ <table class="help_wiki_table" width="100%" border="1px">
<thead>
<tr>
<th>nombre</th>
@@ -153,6 +153,58 @@
</tr>
</table>
+ <h3>Some more examples:</h3>
+
+ <table width="100%" border="1px">
+ <tr>
+ <td>
+ <b>List</b>
+ </td>
+ <td>
+ <ul>
+ <li>first item</li>
+ <li>second item</li>
+ </ul>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[list]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]first item[/*]</li>
+ <li>[*]second item[/*]</li>
+ </ul>
+ </li>
+ <li>[/list]</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Numbered list</b>
+ </td>
+ <td>
+ <ol>
+ <li>first item</li>
+ <li>second item</li>
+ </ol>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[enum]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]first item[/*]</li>
+ <li>[*]second item[/*]</li>
+ </ul>
+ </li>
+ <li>[/enum]</li>
+ </ul>
+ </td>
+ </tr>
+ </table>
+
+
<a name="compatibility"><h1>Clases de Compatibilidad</h1></a>
<a name="notebook-compatibility"><h2>Laptops</h2></a>
diff --git a/h-source/Application/Views/Help/index_fr.php b/h-source/Application/Views/Help/index_fr.php
index c74e06f..d98d13b 100644
--- a/h-source/Application/Views/Help/index_fr.php
+++ b/h-source/Application/Views/Help/index_fr.php
@@ -40,7 +40,7 @@
<h3>Liste des tags Wiki sur <?php echo Website::$generalName;?></h3>
- <table class="help_wiki_table" width="100%">
+ <table class="help_wiki_table" width="100%" border="1px">
<thead>
<tr>
<th>name</th>
@@ -153,6 +153,57 @@
</tr>
</table>
+ <h3>Some more examples:</h3>
+
+ <table width="100%" border="1px">
+ <tr>
+ <td>
+ <b>List</b>
+ </td>
+ <td>
+ <ul>
+ <li>first item</li>
+ <li>second item</li>
+ </ul>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[list]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]first item[/*]</li>
+ <li>[*]second item[/*]</li>
+ </ul>
+ </li>
+ <li>[/list]</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Numbered list</b>
+ </td>
+ <td>
+ <ol>
+ <li>first item</li>
+ <li>second item</li>
+ </ol>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[enum]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]first item[/*]</li>
+ <li>[*]second item[/*]</li>
+ </ul>
+ </li>
+ <li>[/enum]</li>
+ </ul>
+ </td>
+ </tr>
+ </table>
+
<a name="compatibility"><h1>Niveau de compatibilitée</h1></a>
<a name="notebook-compatibility"><h2>Notebooks</h2></a>
diff --git a/h-source/Application/Views/Help/index_it.php b/h-source/Application/Views/Help/index_it.php
index e55d88f..d4f6f7d 100644
--- a/h-source/Application/Views/Help/index_it.php
+++ b/h-source/Application/Views/Help/index_it.php
@@ -40,7 +40,7 @@
<h3>Lista dei tag della wiki di <?php echo Website::$generalName;?></h3>
- <table class="help_wiki_table" width="100%">
+ <table class="help_wiki_table" width="100%" border="1px">
<thead>
<tr>
@@ -170,6 +170,58 @@
</tr>
</table>
+ <h3>Alcuni esempi aggiuntivi:</h3>
+
+ <table width="100%" border="1px">
+ <tr>
+ <td>
+ <b>Lista</b>
+ </td>
+ <td>
+ <ul>
+ <li>primo elemento</li>
+ <li>secondo elemento</li>
+ </ul>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[list]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]primo elemento[/*]</li>
+ <li>[*]secondo elemento[/*]</li>
+ </ul>
+ </li>
+ <li>[/list]</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Lista numerata</b>
+ </td>
+ <td>
+ <ol>
+ <li>first item</li>
+ <li>second item</li>
+ </ol>
+ </td>
+ <td>
+ <ul style="list-style-type:none;">
+ <li>[enum]</li>
+ <li>
+ <ul style="list-style-type:none;">
+ <li>[*]first item[/*]</li>
+ <li>[*]second item[/*]</li>
+ </ul>
+ </li>
+ <li>[/enum]</li>
+ </ul>
+ </td>
+ </tr>
+ </table>
+
+
<a name="compatibility"><h1>Classi di compatibilità</h1></a>
<a name="notebook-compatibility"><h2>Notebooks</h2></a>
diff --git a/h-source/Application/Views/My/panel.php b/h-source/Application/Views/My/panel.php
index 006869f..44f159e 100644
--- a/h-source/Application/Views/My/panel.php
+++ b/h-source/Application/Views/My/panel.php
@@ -26,6 +26,12 @@
<a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> &raquo; panel
</div>
+ <?php if ($isBlocked) { ?>
+ <div class="moderator_box">
+ Your account has been blocked by a moderator of the website. You can neither insert/modify devices nor submit new issues or messages until some other moderator un-block your account.
+ </div>
+ <?php } ?>
+
<ul class='panelApplicationList'>
<li><a href="<?php echo Url::getRoot('meet/user/'.$lang.'/'.$username);?>">Watch your public profile</a></li>
<li><a href="<?php echo Url::getRoot('my/profile/'.$lang.'/'.$token);?>">Edit your profile</a></li>