- common_log(LOG_INFO, "getting to show content.\n");
- if (empty($this->user)) {
- // TODO: should just redirect to the login page.
- $this->element('p', array(), 'You are not logged in');
- } else {
- common_log(LOG_INFO, 'fileroot : ' . $_SERVER['DOCUMENT_ROOT'] . '/file/');
- $dir = opendir($_SERVER['DOCUMENT_ROOT'] . '/file/');
- if ($dir === false) {
- $err = error_get_last();
- common_log(LOG_INFO, 'Error opening dir : ' . $err['message']);
- return;
- }
- $args = $this->returnToArgs();
- foreach (array_keys($args) as $key) {
- common_log(LOG_INFO, $key . ' => ' . $args[$key]);
- if (is_array($args[$key])) {
- foreach (array_keys($args[$key]) as $skey) {
- common_log(LOG_INFO, ' ' . $skey . ' => ' . $args[$key][$skey]);
- }
- }
- }
- $pathparts = explode('/', $args[1]['nickname']);
- $username = $pathparts[0];
-
-
-
- $page = $_GET['pageid'];
- if (!filter_var($page, FILTER_VALIDATE_INT)){
- $page = 1;
- }
+ if(empty($this->user)) {
+ return;
+ }
+ $page = $_GET['pageid'];
+ if (!filter_var($page, FILTER_VALIDATE_INT)){
+ $page = 1;
+ }