From e7eebe74d672416ccbe0dd837d5ef3d5bda145cb Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 13 Mar 2011 00:42:19 +0000 Subject: modified UsersController.php --- .../Application/Controllers/BaseController.php | 8 ++++++ .../Application/Controllers/UsersController.php | 11 ++++++++ h-source/Application/Include/myFunctions.php | 3 +++ h-source/Application/Views/info.php | 30 ++++++++++++++++++++++ h-source/Config/Route.php | 1 + 5 files changed, 53 insertions(+) create mode 100644 h-source/Application/Views/info.php diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php index 5340954..697b79b 100644 --- a/h-source/Application/Controllers/BaseController.php +++ b/h-source/Application/Controllers/BaseController.php @@ -24,6 +24,7 @@ class BaseController extends Controller { protected $lang; + protected $islogged = 'no'; protected $ismoderator = false; protected $isadmin = false; protected $querySanitized = true; @@ -57,6 +58,7 @@ class BaseController extends Controller $this->s['registered']->checkStatus(); $data['username'] = null; + $data['user_groups'] = null; $data['islogged'] = 'no'; $data['token'] = 'token'; $data['ismoderator'] = false; @@ -65,7 +67,13 @@ class BaseController extends Controller if ($this->s['registered']->status['status'] === 'logged') { $data['username'] = $this->s['registered']->status['user']; + $groups = $this->s['registered']->status['groups']; + $groups[] = 'registered'; + $data['user_groups'] = implode(',',$groups); + $data['islogged'] = 'yes'; + $this->islogged = $data['islogged']; + $data['token'] = $this->s['registered']->status['token']; $this->token = $data['token']; diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php index c46da88..b55a461 100644 --- a/h-source/Application/Controllers/UsersController.php +++ b/h-source/Application/Controllers/UsersController.php @@ -117,6 +117,17 @@ class UsersController extends BaseController $this->append($data); $this->load('logout'); } + + public function info($lang = 'en') + { + $this->s['registered']->checkStatus(); + + $data['user_status'] = strcmp($this->islogged,'yes') === 0 ? 'logged' : 'not-logged'; + + $this->append($data); + $this->clean(); + $this->load('info'); + } public function add($lang = 'en') { diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 4d01851..70c0b4f 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -173,6 +173,9 @@ function htmlDiff($old, $new) $old = str_replace("\r\n"," \r\n ",$old); $new = str_replace("\r\n"," \r\n ",$new); + $old = str_replace("\n"," \n ",$old); + $new = str_replace("\n"," \n ",$new); + $ret = null; $diff = diff(removeEmptyStrings(explode(' ', $old)),removeEmptyStrings(explode(' ', $new))); foreach($diff as $k) diff --git a/h-source/Application/Views/info.php b/h-source/Application/Views/info.php new file mode 100644 index 0000000..00d2927 --- /dev/null +++ b/h-source/Application/Views/info.php @@ -0,0 +1,30 @@ + +\n";?> + + + + + + + + + +. +?> \ No newline at end of file diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index 9333134..5cb6195 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -41,6 +41,7 @@ class Route 'users,change', 'users,forgot', 'users,notice', + 'users,info', 'meet,user', 'meet,contributions', 'meet,hardware', -- cgit v1.2.3