public function showList()
 {
     $list = $this->db->SimpleSelect("ge_messages", "*", array('site_id' => ResponseRegistery::getInstance()->site_id))->fetchAll();
     $this->tmpl->loadPage('listMessage');
     $this->tmpl->assign("list", $list);
     $this->reponse->setTemplate($this->tmpl);
 }
Beispiel #2
0
 public function route()
 {
     $reader = Request::getInstance();
     $subdomain = trim($reader->getString('subdomain'));
     $responseReg = ResponseRegistery::getInstance();
     if (empty($subdomain)) {
         $responseReg->controller = 'main';
         return;
     }
     if (!$this->validSubDomain($subdomain)) {
         $responseReg->controller = 'main';
         $responseReg->page = 'WebLogNotFound';
         return;
     }
     $site_id = $this->getSiteId($subdomain);
     $responseReg->site_id = $site_id;
     if (!$site_id) {
         $responseReg->controller = 'main';
         $responseReg->page = 'WebLogNotFound';
         return;
     } else {
         $responseReg->controller = 'site';
         return;
     }
 }
Beispiel #3
0
 protected function run()
 {
     $response = ResponseRegistery::getInstance();
     $controller = $response->controller;
     $ctrl = $this->loadClass(ucfirst($controller) . 'Controller');
     $ctrl->execute();
 }
Beispiel #4
0
 public function save()
 {
     $ob->id = $this->input->getInt('id');
     $ob->answer = $this->input->getString('answer');
     $ob->status = 'close';
     $this->db->StoreObject("ge_messages", $ob);
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . '/admin/message/getlist');
 }
Beispiel #5
0
 public function Delete()
 {
     Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
     try {
         $this->db->delete("ge_ads", $this->input->getInt("id"));
         Messages::getInstance()->logSuccess('تبلیغ مورد نظر  با موفقیت حذف شد');
     } catch (Exception $ex) {
         Messages::getInstance()->logError('هیچ تبلیغی حذف شد');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/ads/show");
 }
Beispiel #6
0
 protected function run()
 {
     $reg = ResponseRegistery::getInstance();
     $application = $reg->application;
     try {
         $ctrl = $this->loadClass(ucfirst($application) . 'Controller');
     } catch (ReflectionException $e) {
         throw new EAccessDenied("application not found '{$application}'");
     }
     $ctrl->execute();
 }
Beispiel #7
0
 private function getWeblogId()
 {
     fb('ssss', FirePHP::TRACE);
     $ob = Factory::getDBO()->SimpleSelect('wb_weblogs', 'id', array("site_id" => ResponseRegistery::getInstance()->site_id))->fetch();
     fb($ob, 'admin');
     if ($ob) {
         return intval($ob->id);
     } else {
         return 0;
     }
 }
Beispiel #8
0
 protected function run()
 {
     $reg = ResponseRegistery::getInstance();
     //$reg->weblog_id = $this->getWeblogId();
     try {
         $service = new ServiceController($reg->service);
         $service->perform($reg->task);
     } catch (ReflectionException $e) {
         throw new EAccessDenied("service : {$reg->service} not found");
     }
 }
 function saveSettings()
 {
     Factory::getUser()->authorise("setting", ResponseRegistery::getInstance()->site_id);
     $object = $this->input->get('POST');
     $object['id'] = Session::getInstance()->weblog_id;
     $user->account_no = $object['account_no'];
     $user->cellphone = $object['cellphone'];
     $user->id = Factory::getUser()->id;
     unset($object['account_no']);
     unset($object['cellphone']);
     $this->db->StoreObject("wb_weblogs", $object);
     $this->db->StoreObject("ge_users", $user);
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . '/dashboard/blog/settings');
 }
 public function saveStatus()
 {
     Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
     fb($this->input->getInt('RequestID'));
     if ($this->input->getInt('RequestID') != 0) {
         $data->id = $this->input->getInt('RequestID');
         $data->status = $this->input->getString('status');
         try {
             $this->db->StoreObject("sh_requests", $data);
             Messages::getInstance()->logSuccess('تغییر مورد نظر با موفقیت انجام شد');
         } catch (Exception $ex) {
             Messages::getInstance()->logError('در انجام عملیات خطایی رخ داده است');
         }
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopRequest/showrequest");
 }
 public function saveCode()
 {
     Factory::getUser()->authorise("template", ResponseRegistery::getInstance()->site_id);
     $db = Factory::getDBO();
     $data->main = $this->input->getString('main');
     $data->id = $this->getWebLogTemplateId();
     $db->StoreObject("ge_templates", $data);
     //Messages::getInstance()->logSuccess('قالب با موفقیت ذخیره و اعمال شد');
     $msg = Messages::getInstance();
     $msg->logSuccess('قالب با موفقیت ذخیره شد');
     if ($this->compile($data->main, $data->id)) {
         $msg->logSuccess('قالب با موفقیت اعمال شد');
     } else {
         $msg->logError('در ساختار قالب خطا وجود دارد لطفا قبل از نمایش وبلاگ این خطاها را بررسی کنید');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/template/show");
 }
Beispiel #12
0
    public function findWeblogAddress()
    {
        $db = Factory::getDBO();
        $sql = 'SELECT
		    site.id,
                    sub_domain
                 FROM ge_subdomains sub
                 JOIN ge_sites as site
                    ON(sub.site_id=site.id)
                 JOIN ge_users_sites as us
                    ON(site.id=us.site_id)
                 WHERE
                    us.user_id=' . intval(Factory::getUser()->id);
        fb(Factory::getUser()->id, 'user_id');
        $sub = $db->query($sql)->fetch();
        if ($sub) {
            ResponseRegistery::getInstance()->site_id = $sub->id;
            return $sub->sub_domain;
        }
        return false;
    }
Beispiel #13
0
 public function __construct()
 {
     parent::__construct();
     $this->respond = ResponseRegistery::getInstance();
 }
Beispiel #14
0
 public function route()
 {
     $input = Request::getInstance();
     ResponseRegistery::getInstance()->service = $input->getString('service');
     ResponseRegistery::getInstance()->task = $input->getString('task');
 }
Beispiel #15
0
 public function logout()
 {
     Factory::getUser()->logout();
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL);
 }
Beispiel #16
0
 public function staticDelete()
 {
     $query = 'DELETE FROM wb_links WHERE weblog_id=' . Session::getInstance()->weblog_id . ' AND id=' . $this->input->getInt("id");
     fb($query);
     try {
         $this->db->execute($query);
         Messages::getInstance()->logSuccess('لینک مورد نطر با موفقیت حذف شد');
     } catch (Exception $ex) {
         Messages::getInstance()->logError('هیچ لینکی حذف نشد');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/link/staticLinks");
 }
Beispiel #17
0
 public function disban()
 {
     Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
     $site_id = $this->input->getInt('id');
     $tmp->id = $site_id;
     $tmp->active = 1;
     Factory::getDBO()->StoreObject("ge_sites", $tmp);
     Messages::getInstance()->logSuccess('سایت مورد نظر با موفقیت فعال شد');
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/blog/show");
 }
Beispiel #18
0
 public function delete()
 {
     Factory::getUser()->authorise("item", ResponseRegistery::getInstance()->site_id);
     try {
         $item_id = $this->input->getInt('id');
         $query = "DELETE FROM sh_subgroups_items WHERE item_id = {$item_id}";
         $this->db->execute($query);
         $query = "DELETE FROM sh_images WHERE item_id = {$item_id}";
         $this->db->execute($query);
         $query = "DELETE FROM sh_items WHERE id = {$item_id}";
         $this->db->execute($query);
         // [FIXIT] images file not delete
         Messages::getInstance()->logSuccess("کالای مورد نظر با موفقیت حذف شد");
     } catch (Exception $e) {
         Messages::getInstance()->logError("هیچ کالایی حذف نشد");
         Messages::getInstance()->logError($e);
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopItem/showItem");
 }
Beispiel #19
0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
     <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          <link type="text/css" rel="stylesheet" href="<?php 
echo ResponseRegistery::getInstance()->baseURL;
?>
/ui/css/firstPage.css" />
          <title>404 Error</title>
     </head>

     <body >
          <div id="header">
          </div>
          <br /><br />
          <center>
               <img src="<?php 
echo ResponseRegistery::getInstance()->baseURL;
?>
/ui/images/404notfound.png" width="500px" height="100px" />
          </center>
     </body>
</html>
Beispiel #20
0
 public function __construct()
 {
     parent::__construct();
     $this->respond = ResponseRegistery::getInstance();
     $this->respond->postPassword = $this->input->getString('postPassword');
 }
Beispiel #21
0
 public function route()
 {
     $url = $_SERVER['REQUEST_URI'];
     $a = $result = array();
     ResponseRegistery::getInstance()->baseURL = 'http://' . $_SERVER["HTTP_HOST"] . '/frotel';
     //ResponseRegistery::getInstance()->baseURL = 'http://' . $_SERVER["HTTP_HOST"];
     if (preg_match("#^([^.]+)\\.valablogg\\.com(:\\d+)?\$#", $_SERVER["HTTP_HOST"], $result) && $result[1] != "www") {
         $_GET["subdomain"] = $result[1];
         if (preg_match("#(blog)/post/(\\d+)/.*\\.html\$#", $url, $a)) {
             $_GET["application"] = $a[1];
             $_GET["service"] = "post";
             $_GET["task"] = "post";
             $_GET["article_id"] = $a[2];
             return;
         }
         if (preg_match("#(blog)(/?|/page(/?|/(\\d+)?/?))?\$#", $url, $a)) {
             $_GET["application"] = $a[1];
             $_GET["service"] = "post";
             $_GET["task"] = "page";
             $_GET["page"] = isset($a[4]) ? intval($a[4]) : 1;
             return;
         }
         if (preg_match("#(blog)/author/([^/]+)/?\$#", $url, $a)) {
             $_GET["application"] = $a[1];
             $_GET["service"] = "post";
             $_GET["task"] = "author";
             $_GET["username"] = $a[2];
             return;
         }
         if (preg_match("#(blog)/tag/([^/]+)/?\$#", $url, $a)) {
             $_GET["application"] = $a[1];
             $_GET["service"] = "post";
             $_GET["task"] = "tag";
             $_GET["tag"] = $a[2];
             return;
         }
         if (preg_match("#(blog)/archive/(\\d{2})/(\\d{1,2})/?\$#", $url, $a)) {
             $_GET["application"] = $a[1];
             $_GET["service"] = "post";
             $_GET["task"] = "archive";
             $_GET["yy"] = $a[2];
             $_GET["mm"] = $a[3];
             return;
         }
         if (preg_match("#(blog)/comment/(\\d+)/?\$#", $url, $a)) {
             $_GET["application"] = $a[1];
             $_GET["service"] = "comment";
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $_GET["task"] = "save";
             } else {
                 $_GET["task"] = "show";
             }
             $_GET["article_id"] = $a[2];
             return;
         }
         if (preg_match("#(shop)(/?|/page(/?|/(\\d+)?/?))?\$#", $url, $a)) {
             $_GET["application"] = $a[1] = 'blog';
             $_GET["service"] = "shop";
             $_GET["task"] = "page";
             $_GET["page"] = isset($a[4]) ? intval($a[4]) : 1;
             return;
         }
         if (preg_match("#(shop)/item/(\\d+)\$#", $url, $a)) {
             $_GET["application"] = $a[1] = 'blog';
             $_GET["service"] = "shop";
             $_GET["task"] = "item";
             $_GET["id"] = $a[2];
             return;
         }
         if (preg_match("#(shop)/fro/(\\d+)\$#", $url, $a)) {
             $_GET["application"] = $a[1] = 'blog';
             $_GET["service"] = "shop";
             $_GET["task"] = "fro_item";
             $_GET["id"] = $a[2];
             return;
         }
         if (preg_match("#(shop)/card/(\\w+)/(\\d+)\$#", $url, $a)) {
             $_GET["application"] = $a[1] = 'blog';
             $_GET["service"] = "card";
             $_GET["task"] = $a[2];
             $_GET["id"] = $a[3];
             return;
         }
         if (preg_match("#(shop)/fcard/(\\w+)/(\\d+)\$#", $url, $a)) {
             $_GET["application"] = $a[1] = 'blog';
             $_GET["service"] = "card";
             $_GET["task"] = 'frotel' . ucfirst($a[2]);
             $_GET["id"] = $a[3];
             return;
         }
         if (preg_match("#captcha\$#", $url, $a)) {
             $_GET["application"] = 'blog';
             $_GET["service"] = "captcha";
             $_GET["task"] = "show";
             return;
         } else {
             Response::getInstance()->redirect(ResponseRegistery::getInstance()->baseURL . '/blog');
             return;
         }
         die('عملیات مورد نظر امکان پذیر نیست');
     } else {
         if (preg_match("#^(www\\.)?valablogg\\.com(:\\d+)?\$#", $_SERVER["HTTP_HOST"], $result)) {
             if (preg_match("#admin/(\\w+)/(\\w+)(/(\\d+))?#", $url, $a)) {
                 $_GET["application"] = 'admin';
                 $_GET["service"] = "Admin" . ucfirst($a[1]);
                 $_GET["task"] = $a[2];
                 $_GET["id"] = isset($a[3]) ? $a[4] : 0;
                 return;
             }
             if (preg_match("#trace/(\\w+)(/([a-zA-Z0-9\\-]+))?#", $url, $a)) {
                 $_GET["application"] = 'dashboard';
                 $_GET["service"] = "Trace";
                 $_GET["task"] = $a[1];
                 $_GET["traceID"] = isset($a[3]) ? $a[3] : 0;
                 return;
             } else {
                 if (preg_match("#dashboard/(\\w+)/(\\w+)(/(\\d+))?#", $url, $a)) {
                     $_GET["application"] = 'dashboard';
                     $_GET["service"] = "Dashboard" . ucfirst($a[1]);
                     $_GET["task"] = $a[2];
                     $_GET["id"] = isset($a[3]) ? $a[4] : 0;
                     return;
                 } else {
                     if (preg_match("#user/(\\w+)#", $url, $a)) {
                         $_GET["application"] = 'dashboard';
                         $_GET["service"] = "User";
                         $_GET["task"] = $a[1];
                         return;
                     } else {
                         if (preg_match("#dashboard#", $url, $a)) {
                             Response::getInstance()->redirect(ResponseRegistery::getInstance()->baseURL . '/dashboard/post/oldpost');
                             return;
                         } else {
                             if (preg_match("#page/(\\w+)#", $url, $a)) {
                                 $_GET["application"] = 'dashboard';
                                 //FIXME chage this
                                 $_GET["service"] = "Site";
                                 $_GET["task"] = $a[1];
                                 return;
                             } else {
                                 if (preg_match("#click/(\\w+)#", $url, $a)) {
                                     $_GET["application"] = 'dashboard';
                                     //FIXME chage this
                                     $_GET["service"] = "ClickAds";
                                     $_GET["task"] = $a[1];
                                 } else {
                                     $_GET["application"] = 'dashboard';
                                     //FIXME chage this
                                     $_GET["service"] = "Site";
                                     if (empty($a[1])) {
                                         $_GET["task"] = 'firstPage';
                                     } else {
                                         $_GET["task"] = $a[1];
                                     }
                                     return;
                                 }
                             }
                         }
                     }
                 }
             }
         } else {
             die("no");
             Response::getInstance()->redirect(ResponseRegistery::getInstance()->baseURL . '/error.php');
             return;
             die("ص�?حه مورد نظر پیدا نشد");
         }
     }
 }
Beispiel #22
0
 private function loadPreviousItem()
 {
     $sql = "SELECT\n\t\t\t\t\tarticle.title as posttitle,\n\t\t\t\t\tarticle.id as postid,\n\t\t\t\t\tconcat('post/',article.id,'/',article.alias,'.html') as postlink\n\t\t\t\t FROM wb_article as article\n\t\t\t\t WHERE\n\t\t\t\t\tstatus='published' and \n\t\t\t\t\tweblog_id=" . ResponseRegistery::getInstance()->weblog_id;
     $this->data['blogpreviousitems'] = $this->db->query($sql)->fetchAll();
     $this->data['blogpreviousitemsblock'] = count($this->data['blogpreviousitems']) != 0;
 }
Beispiel #23
0
 public function __construct()
 {
     parent::__construct();
     $this->respond = ResponseRegistery::getInstance();
     $this->tmpl = Template::getInstance('frontPage.tpl');
 }
Beispiel #24
0
 public function route()
 {
     $reg = ResponseRegistery::getInstance();
     $application = Request::getInstance()->getString('application');
     $reg->application = $application;
 }
Beispiel #25
0
 public function FrotelSave()
 {
     $data = $this->input->get('post');
     $data['code'] = $this->genCode();
     $site_id = intval(ResponseRegistery::getInstance()->site_id);
     $this->db->StoreObject("sh_requests", $data);
     $tmp->request_id = $this->db->insert_id();
     $card = $this->getFrotelCard();
     foreach ($card[$site_id]->items as $item) {
         $tmp->item_id = $item->id;
         $this->db->StoreObject("sh_items_requests", $tmp);
     }
     $tmpl = Template::getInstance('finish_checkout.tpl');
     $tmpl->assign('code', $data['code']);
     $this->reponse->setTemplate($tmpl);
     $this->reponse->setTitle('اتمام خرید');
     unset($card[$site_id]);
     $this->saveFrotelCard($card);
 }
 public function deleteSubgroup()
 {
     Factory::getUser()->authorise("group", ResponseRegistery::getInstance()->site_id);
     try {
         $this->db->delete("sh_subgroups", $this->input->getInt('id'));
         Messages::getInstance()->logSuccess("زیر گروه مورد نظر با موفقیت حذف شد");
     } catch (Exception $e) {
         Messages::getInstance()->logError("هیچ زیر گروهی حذف نشد");
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopGroup/showGroups");
 }
Beispiel #27
0
 public function commentDelete()
 {
     Factory::getUser()->authorise("comment", ResponseRegistery::getInstance()->site_id);
     try {
         $sql = 'DELETE FROM  wb_comment WHERE id=' . $this->input->getInt('id');
         //FIXME. ' and weblog_id=' . Session::getInstance()->weblog_id;
         $this->db->execute($sql);
     } catch (MySQLException $e) {
         if ($e->getCode() == 1451) {
             fb($e);
             Messages::getInstance()->logWarning('یک یا چند پست با این موضع وجود دارد ابتدا انها را ویرایش کنید');
         } else {
             throw $e;
         }
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/post/comment");
 }