예제 #1
0
 function details()
 {
     $juser =& JFactory::getUser();
     $username = JRequest::getString('user', $juser->username);
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php';
     $profile_id = generalHelpers::getUserId($username);
     if (is_null($profile_id)) {
         $profile_id = $juser->id;
     }
     $id = JRequest::getInt('id');
     $rows = new stdClass();
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'user.php';
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'wedding.php';
     $tmpl = userHelpers::getCurrentTemplate($profile_id);
     $css = weddingHelper::getTemplateFolder('css', $tmpl->code);
     $images = weddingHelper::getTemplateFolder('images', $tmpl->code);
     $rows->images = $images;
     $rows->css = $css;
     $rows->menu = userHelpers::getUserMenu($profile_id);
     $this->_view->addTemplatePath(JPATH_COMPONENT . DS . 'templates' . DS . $tmpl->code . DS);
     $rows->userdata = userHelpers::getUserData($profile_id);
     $rows->photos = $this->_model->getPhotos($id);
     $this->_view->setLayout('index');
     $this->_view->details($rows);
 }
예제 #2
0
 function checkpassword($view, $type)
 {
     $url = JURI::current();
     $session =& JFactory::getSession();
     $login = $session->get('com_wedding.' . $view . 'login', 0);
     if (!$login) {
         $juser =& JFactory::getUser();
         $username = JRequest::getString('user', $juser->username);
         require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php';
         $profile_id = generalHelpers::getUserId($username);
         if (is_null($profile_id)) {
             $profile_id = $juser->id;
         }
         if ($profile_id != $juser->id) {
             $url = 'index.php?option=com_wedding&view=' . $view;
             $dbo =& JFactory::getDbo();
             $query = "SELECT id FROM #__wedding_apps WHERE `url` = '{$url}'";
             $dbo->setQuery($query);
             $app_id = $dbo->loadResult();
             $query = "SELECT `password` FROM #__wedding_userapps WHERE user_id = {$profile_id} AND app_id = {$app_id}";
             $dbo->setQuery($query);
             $password = $dbo->loadResult();
             if (!empty($password)) {
                 $uri = JFactory::getURI();
                 $url = $uri->toString(array('path', 'query', 'fragment'));
                 $this->_view =& $this->getView('auth', $type);
                 $this->_view->addTemplatePath(JPATH_COMPONENT . DS . 'templates' . DS . 'default' . DS);
                 $this->_view->setLayout('auth.default');
                 $this->_view->display($view, $uri, $profile_id, $app_id);
                 exit;
             }
         }
     }
     return false;
 }