diff --git a/application/modules/default/controllers/HomeController.php b/application/modules/default/controllers/HomeController.php index 7bb4dc27c..9fcf4d362 100644 --- a/application/modules/default/controllers/HomeController.php +++ b/application/modules/default/controllers/HomeController.php @@ -1,665 +1,667 @@ . **/ class HomeController extends Local_Controller_Action_DomainSwitch { public function indexAction() { - if (!Zend_Auth::getInstance()->hasIdentity()){ - $this->forward('start', 'home', 'default',null); - } - + /** @var Default_Model_ConfigStore $storeConfig */ $storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null; if ($storeConfig) { $this->view->tag_filter = Zend_Registry::isRegistered('config_store_tags') ? Zend_Registry::get('config_store_tags') : null; if ($storeConfig->isShowHomepage()) { $index = $this->getParam('index'); if ($index) { if ((int)$index == 1) { $this->_helper->viewRenderer('index-' . $storeConfig->config_id_name . '-test'); } else { $this->_helper->viewRenderer('index-' . $storeConfig->config_id_name . '-test' . $index); } $this->view->index = $index; } else { - $this->_helper->viewRenderer('index-' . $storeConfig->config_id_name); + + if ($storeConfig->config_id_name=='opendesktop' && !Zend_Auth::getInstance()->hasIdentity()){ + $this->forward('start', 'home', 'default',null); + }else{ + $this->_helper->viewRenderer('index-' . $storeConfig->config_id_name); + } } return; } } $params = array('ord' => 'latest'); if ($this->hasParam('domain_store_id')) { $params['domain_store_id'] = $this->getParam('domain_store_id'); } $this->forward('index', 'explore', 'default', $params); } public function startAction() { /** @var Default_Model_ConfigStore $storeConfig */ $storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null; if ($storeConfig) { $this->view->tag_filter = Zend_Registry::isRegistered('config_store_tags') ? Zend_Registry::get('config_store_tags') : null; if ($storeConfig->isShowHomepage()) { //index-opendesktop-start.phtml view $this->_helper->viewRenderer('index-' . $storeConfig->config_id_name . '-start'); return; } } $params = array('ord' => 'latest'); if ($this->hasParam('domain_store_id')) { $params['domain_store_id'] = $this->getParam('domain_store_id'); } $this->forward('index', 'explore', 'default', $params); } public function showfeatureajaxAction() { $this->_helper->layout->disableLayout(); $modelInfo = new Default_Model_Info(); $page = (int)$this->getParam('page'); $type = ''; if ($page == 0) { $featureProducts = $modelInfo->getRandProduct(); $type = ''; } elseif ($page == 1) { $featureProducts = $modelInfo->getRandFeaturedProduct(); $type = 'Featured'; } elseif ($page == 2) { $featureProducts = $modelInfo->getRandPlingedProduct(); $type = 'Plinged'; } $this->view->featureProducts = $featureProducts; $this->view->type = $type; $this->_helper->viewRenderer('/partials/featuredProducts'); } public function showlastproductsjsonAction() { $this->_helper->layout->disableLayout(); $modelInfo = new Default_Model_Info(); $offset = (int)$this->getParam('offset', 0); $limit = (int)$this->getParam('limit', 5); $catIds = $this->getParam('catIDs'); $tags = $this->getParam('ptype'); $isOriginal = $this->getParam('isoriginal'); $response = $modelInfo->getJsonLastProductsForHostStores($limit, $catIds, $tags, $isOriginal, $offset); $this->_helper->json(Zend_Json::decode($response)); } public function getnewactiveplingedproductjsonAction() { $this->_helper->layout->disableLayout(); $modelInfo = new Default_Model_Info(); $offset = (int)$this->getParam('offset', 0); $limit = (int)$this->getParam('limit', 5); $response = $modelInfo->getJsonNewActivePlingProduct($limit, $offset); $this->_helper->json(Zend_Json::decode($response)); } public function showfeaturejsonAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $modelInfo = new Default_Model_Info(); $page = (int)$this->getParam('page'); if ($page == 0) { $featureProducts = $modelInfo->getRandProduct(); $featureProducts->setItemCountPerPage(1); $featureProducts->setCurrentPageNumber(1); } else { $featureProducts = $modelInfo->getFeaturedProductsForHostStores(100); if ($featureProducts->getTotalItemCount() > 0) { $offset = (int)$this->getParam('page'); $irandom = rand(1, $featureProducts->getTotalItemCount()); $featureProducts->setItemCountPerPage(1); $featureProducts->setCurrentPageNumber($irandom); } } $item = null; foreach ($featureProducts as $i) { $item = $i; break; } $helpCategories = new Default_View_Helper_FetchCategoriesForProductAsString(); $response = array( 'project_id' => $item['project_id'], 'member_id' => $item['member_id'], 'username' => $item['username'], 'profile_image_url' => $item['profile_image_url'], 'featured' => $item['featured'], 'description' => $item['description'], 'title' => $item['title'], 'category' => $helpCategories->fetchCategoriesForProductAsString($item['project_id']), 'image_small' => $item['image_small'], 'laplace_score' => $item['laplace_score'], 'count_likes' => $item['count_likes'], 'count_dislikes' => $item['count_dislikes'], 'changed_at' => $item['changed_at'], 'created_at' => $item['created_at'], 'count_comments' => $item['count_comments'] ); $this->_helper->json($response); } public function showspotlightjsonAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $modelInfo = new Default_Model_Info(); $page = (int)$this->getParam('page'); $mostplingedcreateor = $modelInfo->getMostPlingedCreators(1, $page); $creator = array_pop($mostplingedcreateor); $helperImage = new Default_View_Helper_Image(); $creator['profile_image_url'] = $helperImage->Image($creator['profile_image_url'], array('width' => 200, 'height' => 200)); $products = $modelInfo->getMostPlingedProductsForUser($creator['member_id'], 5, 0); foreach ($products as &$p) { $p['image_small'] = $helperImage->Image($p['image_small'], array('width' => 200, 'height' => 200)); } $creator['products'] = $products; $this->_helper->json($creator); } public function metamenujsAction() { $this->_helper->layout()->disableLayout(); header('Access-Control-Allow-Origin: *'); $this->getResponse() ->setHeader('Access-Control-Allow-Origin', '*') ->setHeader('Access-Control-Allow-Credentials', 'true') ->setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') ->setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept'); } public function metamenubundlejsAction() { $this->_helper->layout()->disableLayout(); } public function searchmemberAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $username = $this->getParam('username'); $results = null; if (strlen(trim($username)) > 2) { $model = new Default_Model_Member(); $results = $model->findActiveMemberByName($username); $helperImage = new Default_View_Helper_Image(); foreach ($results as &$value) { $avatar = $helperImage->image($value['profile_image_url'], array('width' => 100, 'height' => 100, 'crop' => 2)); $value['profile_image_url'] = $avatar; } } $this->_helper->json($results); } public function memberjsonAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $member_id = $this->getParam('member_id'); $results = null; if ($member_id) { $info = new Default_Model_Info(); $commentsOpendeskop = $info->getDiscussionOpendeskop($member_id); $results = array('commentsOpendeskop' => $commentsOpendeskop); } $this->_helper->json($results); } public function baseurlajaxAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); header('Access-Control-Allow-Origin: *'); $this->getResponse() ->setHeader('Access-Control-Allow-Origin', '*') ->setHeader('Access-Control-Allow-Credentials', 'true') ->setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') ->setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept'); $resultArray = array(); $baseurl = Zend_Registry::get('config')->settings->client->default->baseurl; $resultArray['base_url'] = $baseurl; $resultAll = array(); $resultAll['status'] = "success"; $resultAll['data'] = $resultArray; $this->_helper->json($resultAll); } public function forumurlajaxAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); header('Access-Control-Allow-Origin: *'); $this->getResponse() ->setHeader('Access-Control-Allow-Origin', '*') ->setHeader('Access-Control-Allow-Credentials', 'true') ->setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') ->setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept'); $resultArray = array(); $url_forum = Zend_Registry::get('config')->settings->client->default->url_forum; $resultArray['url_forum'] = $url_forum; $resultAll = array(); $resultAll['status'] = "success"; $resultAll['data'] = $resultArray; $this->_helper->json($resultAll); } public function blogurlajaxAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); header('Access-Control-Allow-Origin: *'); $this->getResponse() ->setHeader('Access-Control-Allow-Origin', '*') ->setHeader('Access-Control-Allow-Credentials', 'true') ->setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') ->setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept'); $resultArray = array(); $url_blog = Zend_Registry::get('config')->settings->client->default->url_blog; $resultArray['url_blog'] = $url_blog; $resultAll = array(); $resultAll['status'] = "success"; $resultAll['data'] = $resultArray; $this->_helper->json($resultAll); } public function storenameajaxAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); header('Access-Control-Allow-Origin: *'); $this->getResponse() ->setHeader('Access-Control-Allow-Origin', '*') ->setHeader('Access-Control-Allow-Credentials', 'true') ->setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') ->setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept'); $resultArray = array(); $sname = Zend_Registry::get('store_host'); $resultArray['store_name'] = $sname; $resultAll = array(); $resultAll['status'] = "success"; $resultAll['data'] = $resultArray; $this->_helper->json($resultAll); } public function loginurlajaxAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); header('Access-Control-Allow-Origin: *'); $this->getResponse() ->setHeader('Access-Control-Allow-Origin', '*') ->setHeader('Access-Control-Allow-Credentials', 'true') ->setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') ->setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept'); $resultArray = array(); $url = $this->getParam('url'); $filterRedirect = new Local_Filter_Url_Encrypt(); $loginUrl = '/login?redirect=' . $filterRedirect->filter($url); $resultArray['login_url'] = $loginUrl; $resultAll = array(); $resultAll['status'] = "success"; $resultAll['data'] = $resultArray; $this->_helper->json($resultAll); } public function domainsajaxAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); header('Access-Control-Allow-Origin: *'); $this->getResponse() ->setHeader('Access-Control-Allow-Origin', '*') ->setHeader('Access-Control-Allow-Credentials', 'true') ->setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') ->setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept'); $resultArray = array(); $domainobjects = $this->fetchMetaheaderMenuJson(); $resultArray['domains'] = $domainobjects; $storeobjects = $this->fetchStoresForCatTreeJson(); $resultArray['storefortree'] = $storeobjects; $resultAll = array(); $resultAll['status'] = "success"; $resultAll['data'] = $resultArray; $this->_helper->json($resultAll); } private function fetchMetaheaderMenuJson() { $sname = Zend_Registry::get('store_host'); /** @var Zend_Cache_Core $cache */ $cache = Zend_Registry::get('cache'); $cacheName = __FUNCTION__ . md5($sname); if (false == ($domainobjects = $cache->load($cacheName))) { $tbl = new Default_Model_DbTable_ConfigStore(); $result = $tbl->fetchDomainObjects(); // sort Desktop manuelly to the front $arrayDesktop = array(); $arrayRest = array(); foreach ($result as $obj) { $o = $obj['order']; $curOrder = floor($obj['order'] / 1000); if ($curOrder < 10 or $curOrder > 50) { continue; } $obj['calcOrder'] = $curOrder; $tmp = array(); $tmp['order'] = $obj['order']; $tmp['calcOrder'] = $obj['calcOrder']; $tmp['host'] = $obj['host']; $tmp['name'] = $obj['name']; $tmp['is_show_in_menu'] = $obj['is_show_in_menu']; $tmp['is_show_real_domain_as_url'] = $obj['is_show_real_domain_as_url']; if ($curOrder == 30) { // Desktop set calcOrder = 9 manuelly put desktop in front $tmp['calcOrder'] = 9; $arrayDesktop[] = $tmp; } else { $arrayRest[] = $tmp; } } $domainobjects = array_merge($arrayDesktop, $arrayRest); $baseurl = Zend_Registry::get('config')->settings->client->default->baseurl; // set group name manully foreach ($domainobjects as &$obj) { if ($sname == $obj['host']) { $obj['menuactive'] = 1; } else { $obj['menuactive'] = 0; } $order = $obj['order']; //OLD: z.b 150001 ende ==1 go real link otherwise /s/$name /*$last_char_check = substr($order, -1); if($last_char_check=='1') { $obj['menuhref'] = $obj['host']; }else{ $obj['menuhref'] = $baseurl.'/s/'.$obj['name']; } * */ $domainAsUrl = $obj['is_show_real_domain_as_url']; if ($domainAsUrl) { $obj['menuhref'] = $obj['host']; } else { $obj['menuhref'] = $baseurl . '/s/' . $obj['name']; } switch ($obj['calcOrder']) { case 9: $obj['menugroup'] = 'Desktops'; break; case 10: $obj['menugroup'] = 'Applications'; break; case 20: $obj['menugroup'] = 'Addons'; break; case 40: $obj['menugroup'] = 'Artwork'; break; case 50: $obj['menugroup'] = 'Other'; break; } } $cache->save($domainobjects, $cacheName, array(), 28800); } return Zend_Json::encode($domainobjects); } private function fetchStoresForCatTreeJson() { $sname = Zend_Registry::get('store_host'); /** @var Zend_Cache_Core $cache */ $cache = Zend_Registry::get('cache'); $cacheName = __FUNCTION__ . md5($sname); if (false == ($domain_objects = $cache->load($cacheName))) { $tbl = new Default_Model_DbTable_ConfigStore(); $result = $tbl->fetchDomainObjects(); // sort Desktop manually to the front $arrayDesktop = array(); $arrayRest = array(); foreach ($result as $obj) { $tmp = array(); $tmp['order'] = $obj['order']; $tmp['calcOrder'] = $obj['calcOrder']; $tmp['host'] = $obj['host']; $tmp['name'] = $obj['name']; $tmp['is_show_in_menu'] = $obj['is_show_in_menu']; $tmp['is_show_real_domain_as_url'] = $obj['is_show_real_domain_as_url']; $arrayRest[] = $tmp; } $domain_objects = array_merge($arrayDesktop, $arrayRest); $baseurl = Zend_Registry::get('config')->settings->client->default->baseurl; // set group name manully foreach ($domain_objects as &$obj) { if ($sname == $obj['host']) { $obj['menuactive'] = 1; } else { $obj['menuactive'] = 0; } $order = $obj['order']; //OLD: z.b 150001 ende ==1 go real link otherwise /s/$name /*$last_char_check = substr($order, -1); if($last_char_check=='1') { $obj['menuhref'] = $obj['host']; }else{ $obj['menuhref'] = $baseurl.'/s/'.$obj['name']; } * */ $domainAsUrl = $obj['is_show_real_domain_as_url']; if ($domainAsUrl) { $obj['menuhref'] = $obj['host']; } else { $obj['menuhref'] = $baseurl . '/s/' . $obj['name']; } } $cache->save($domain_objects, $cacheName, array(), 28800); } return Zend_Json::encode($domain_objects); } /** * @throws Exception * @throws Zend_Exception * @throws Zend_Form_Exception */ public function redirectmeAction() { $this->_helper->layout()->disableLayout(); //$this->_helper->viewRenderer->setNoRender(true); $redir = "/"; if (isset($_GET['redirect'])) { $redir = $_GET['redirect']; $filter = new Local_Filter_Url_Decrypt(); $redir = $filter->filter($redir); } $this->view->redirect = $redir; } public function fetchforgitAction() { $this->_helper->layout()->disableLayout(); $tableProject = new Default_Model_Project(); $params = $this->getAllParams(); $action = 'fetch-products-for-git-project-id'; if ($this->hasParam('target')) { $action = $params['target']; } if ($action == 'fetch-products-for-git-project-id') { $gitProjectId = $params['project_id']; $this->view->products = null; if (isset($gitProjectId)) { $products = $tableProject->fetchAll('status = 100 AND type_id = 1 AND is_gitlab_project = 1 AND gitlab_project_id = ' . $gitProjectId); $helperImage = new Default_View_Helper_Image(); $viewArray = array(); $viewProjectArray = array(); foreach ($products as $product) { $viewProjectArray = array(); $viewProjectArray['project_id'] = $product['project_id']; $viewProjectArray['title'] = $product['title']; $viewProjectArray['version'] = $product['version']; $viewProjectArray['member_id'] = $product['member_id']; $viewProjectArray['avatar'] = $helperImage->Image($product['image_small'], array('width' => 100, 'height' => 100)); $viewArray[] = $viewProjectArray; } $this->view->viewdata = $viewArray; } } else { $this->view->viewdata = array(); } } protected function setLayout() { $storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null; if ($storeConfig && $storeConfig->layout_home) { $this->_helper->layout()->setLayout($storeConfig->layout_home); } else { $this->_helper->layout()->setLayout('home_template'); } } } diff --git a/application/modules/default/views/scripts/home/index-opendesktop-start.phtml b/application/modules/default/views/scripts/home/index-opendesktop-start.phtml index 592e90ffb..22d3a9f7c 100755 --- a/application/modules/default/views/scripts/home/index-opendesktop-start.phtml +++ b/application/modules/default/views/scripts/home/index-opendesktop-start.phtml @@ -1,539 +1,539 @@ . **/ $this->headTitle($_SERVER['HTTP_HOST'], 'SET'); $this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA); $this->headMeta()->appendProperty('og:url', 'www.opendesktop.org'); $this->headMeta()->appendProperty('og:type', 'website'); $this->headMeta()->appendProperty('og:title', 'opendesktop.org'); $this->headMeta()->appendProperty('og:site_name','www.opendesktop.org'); $this->headMeta()->appendProperty('og:description','A community where developers and artists share applications, themes and other content'); $this->headMeta()->appendProperty('og:image','https://www.opendesktop.org/images/system/opendesktop-logo.png'); ?>

Opendesktop.org

One account.
All possibilities.

Opendesktop.org is a libre platform providing free cloud storage, online office editing, contacts & calender tools, personal chat and messaging, as well as project development and product publishing to anyone who values freedom and openness.

Get a free account to enjoy true freedom with all the services below:

Opendesktop.org does not sell your data.

We value your privacy. Check our Privacy Policy

Opendesktop.orgProducts

Libre publishing for artists and creators.

Pling is an open store, where creators can publish their libre products and creative content. Others can support them, so they get a small compensation each time a product is downloaded.

Pling.com

Based on:

ocs-webserver

Replace these services with Opendesktop.org Products:

Amazon
Store
Google
Playstore

Opendesktop.orgProjects

Create, view, and manage code and project data through powerful branching tools.

Web-based DevOps lifecycle tool that provides a Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features, using an open-source license.

openCode.net

Based on:

GitLab

Replace these services with Opendesktop.org Projects:

Microsoft
Github
Atlassian
Bitbucket
AWS
Elastic Beanstalk

Opendesktop.orgFiles

An Enterprise File Sync and Share solution that keeps data under control.

Easy access to files, photos and documents to work and share with team members, customers and partners. Opendesktop.org Files is an open source file sync and share solution designed to be easy-to-use and highly secure.

Opendesktop.org Files

Based on:

Nextcloud
Files

Replace these services with Opendesktop.org Files:

Google
Drive
Microsoft
OneDrive
Dropbox
Dropbox
Box
Box

Opendesktop.orgCalendar

We’re not reinventing the wheel. Based on the popular JavaScript libraries.

The Calendar app is a user interface for Opendesktop's CalDAV server. Easily sync events from various devices with your Opendesktop.org and edit them online.

Opendesktop.org Calendar

Based on:

Nextcloud
Calendar

Replace these services with Opendesktop.org Contacts:

Google
Calendar
Microsoft
Planner
Telegram
Calendar

Opendesktop.orgContacts

Sharing of Adressbooks. You want to share your contacts with your friends or coworkers? No problem!

The Opendesktop.org Contacts app is a user interface for Opendesktop.org's CardDAV server. Easily sync contacts from various devices with your Opendesktop.org and edit them online.

Opendesktop.org Contacts

Based on:

Nextcloud
Contacts

Replace these services with Opendesktop.org Contacts:

Google
Contacts
Microsoft
Phonebook
Telegram
People

Opendesktop.orgDirect Messages

Easy communication with Opendesktop.org members.

A direct message is just like a post but can only be viewed by the recipients. You can include multiple people in a private message.

Based on:

Discourse
Private Messages

Opendesktop.orgMusic

Plays audio files directly in the Files view or in a separate library view.

Shows audio files stored in your cloud categorized by artists and albums. Supports mp3, and depending on the browser, many other audio formats too. Supports shuffle play and playlists. The Music app also allows serving audio files from your cloud to external applications which are compatible either with Ampache or Subsonic.

Opendesktop.org Music

Opendesktop.orgChat

Liberate your communication.

Communicate the way you want with Riot - a universal secure chat app entirely under your control. Keep your conversations secret. State of the art end-to-end encryption ensures that private communication stays private.

Opendesktop.org Chat

Based on:

Riotchat
Matrix protocol

Replace these services with Opendesktop.org Chat:

Microsoft
Skype
-
Facebook
+
Facebook
Messenger
Whatsapp
-
+
Messenger

Opendesktop.orgForums

Open source discussion platform built for the next decade of the Internet.

Building friendships via publishing content, working on projects, commenting and supporting projects is at the heart of the Opendesktop.org community.

Use it as a mailing list, discussion forum, long-form chat room, and more!

Opendesktop.org Forums

Opendesktop.orgMaps

The whole world fits inside your cloud.

Using OpenStreetMap and Leaflet, you can choose between standard map, satellite, topographical, dark mode or even watercolor.

Opendesktop.org Maps

Based on:

OpenStreetMap
Leaflet

Replace these services with Opendesktop.org Maps:

Google
Maps
Microsoft
Maps
Apple
Maps

Opendesktop.orgSocial

Social networking, back in your hands.

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. All on a platform that is community-owned and ad-free.

Opendesktop.org Social

Based on:

Mastodon

Replace these services with Opendesktop.org Social:

Facebook
Twitter
Instagram

What you get

Protecting your privacy.

State of the art end-to-end encryption ensures that private communication stays private.

Everything at your fingertips.

Register one account to have everything in one place.

Keep everything in sync.

Use CardDAV, CalDAV, WebDAV to sync your data to your favorite apps, devices and platform.

Join Opendesktop.org now

© Opendesktop.org