File indexing completed on 2024-12-29 05:24:44
0001 <?php 0002 /** 0003 * ocs-webserver 0004 * 0005 * Copyright 2016 by pling GmbH. 0006 * 0007 * This file is part of ocs-webserver. 0008 * 0009 * This program is free software: you can redistribute it and/or modify 0010 * it under the terms of the GNU Affero General Public License as 0011 * published by the Free Software Foundation, either version 3 of the 0012 * License, or (at your option) any later version. 0013 * 0014 * This program is distributed in the hope that it will be useful, 0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0017 * GNU Affero General Public License for more details. 0018 * 0019 * You should have received a copy of the GNU Affero General Public License 0020 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0021 **/ 0022 ?> 0023 <?php /* 0024 <link href="/theme/react/assets/css/metaheader.css" rel="stylesheet"> 0025 <script type="text/javascript" src="/theme/react/lib/react/react.js"></script> 0026 <script type="text/javascript" src="/theme/react/lib/react-dom/react-dom.js"></script> 0027 <div id="metaheader"></div> 0028 <script src="/home/metamenujs?target=opendesktop&url=<?= $this->serverUrl(). $this->url() ?>&v=1.8" ></script> 0029 <script type="text/javascript" src="/theme/react/metaheader.js?v=1.8"></script> 0030 <link href="/theme/react/assets/css/metaheader.css" rel="stylesheet"> 0031 0032 // version 2 0033 <opendesktop-metaheader config-target="opendesktop"> </opendesktop-metaheader> 0034 <script src="/theme/react-app/bundle/metaheader-bundle.js?<?= APPLICATION_VERSION ?>"></script> 0035 0036 // version 3 local no ajax 0037 */ 0038 ?> 0039 0040 0041 0042 <?php 0043 //Change from opendesktop to pling 0044 $baseurl = Zend_Registry::get('config')->settings->client->default->baseurl; 0045 $baseurlStore = Zend_Registry::get('config')->settings->client->default->baseurl_store; 0046 $searchbaseurl = $this->buildSearchBaseUrl(); 0047 $url_forum = Zend_Registry::get('config')->settings->client->default->url_forum; 0048 $url_blog = Zend_Registry::get('config')->settings->client->default->url_blog; 0049 $url_gitlab = Zend_Registry::get('config')->settings->client->default->url_gitlab; 0050 $url_riot = Zend_Registry::get('config')->settings->client->default->url_riot; 0051 $url_myopendesktop = Zend_Registry::get('config')->settings->client->default->url_myopendesktop; 0052 $url_cloudopendesktop = Zend_Registry::get('config')->settings->client->default->url_cloudopendesktop; 0053 $url_musicopendesktop = Zend_Registry::get('config')->settings->client->default->url_musicopendesktop; 0054 $url_mastodon = Zend_Registry::get('config')->settings->client->default->url_mastodon; 0055 $url_docsopendesktop = Zend_Registry::get('config')->settings->client->default->url_docsopendesktop; 0056 0057 $filter = new Local_Filter_Url_Encrypt(); 0058 $url_login; 0059 $url_logout; 0060 0061 // intern metaheader diff opendesktop/pling 0062 $storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null; 0063 $target = 'pling'; 0064 if($storeConfig->config_id_name=='opendesktop' or $storeConfig->config_id_name=='kde-store') 0065 { 0066 $target = $storeConfig->config_id_name; 0067 } 0068 0069 if(isset($_GET['target'])) { 0070 $target = $_GET['target']; 0071 } 0072 $targetObject=array(); 0073 $targetObject['target'] = $target; 0074 if($target=="pling") 0075 { 0076 $targetObject['logo'] = "pling"; 0077 $targetObject['logoLabel'] = ""; 0078 $targetObject['link'] = $baseurlStore; 0079 }else if($target=="kde-store") 0080 { 0081 $targetObject['logo'] = "kdeStore"; 0082 $targetObject['logoLabel'] = "store.kde.org"; 0083 $targetObject['link'] = 'https://store.kde.org/'; 0084 }else { 0085 $targetObject['logo'] = "opendesktop"; 0086 $targetObject['logoLabel'] = "OpenDesktop"; 0087 $targetObject['link'] = $baseurl; 0088 } 0089 0090 0091 $thisurl = "/"; 0092 if(isset($_GET['url'])) { 0093 $thisurl = $_GET['url']; 0094 }else 0095 { 0096 $thisurl= Zend_Controller_Front::getInstance()->getRequest()->getScheme() . '://' . Zend_Controller_Front::getInstance()->getRequest()->getHttpHost().$_SERVER["REQUEST_URI"]; 0097 } 0098 0099 //20200120 ronald: after login go to /start 0100 //$url_login = "/login/redirect/".$filter->filter($thisurl); 0101 $uri = $_SERVER['REQUEST_URI']; 0102 if($uri == '/' || $uri == '') { 0103 $url_login = "/login"; 0104 } else { 0105 $url_login = "/login/redirect/".$filter->filter($thisurl); 0106 } 0107 $url_logout = "/logout?redirect=".$filter->filter($thisurl); 0108 $isExternal = 'var isExternal = false;'; 0109 $is_external = false; 0110 0111 $helperUserRole = new Backend_View_Helper_UserRole(); 0112 $userRoleName = $helperUserRole->userRole(); 0113 $isAdmin = false; 0114 if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { 0115 $isAdmin = true; 0116 } 0117 0118 0119 $user = null; 0120 $metamenuTheme = ''; 0121 $contentTheme = ''; 0122 if (Zend_Auth::getInstance()->hasIdentity()){ 0123 $identity = Zend_Auth::getInstance()->getStorage()->read(); 0124 $helperImage = new Default_View_Helper_Image(); 0125 $avatar = $helperImage->image($identity->profile_image_url,array('width' => 100, 'height' => 100, 'crop' => 2)); 0126 $isSupporter = $this->isSupporter($identity->member_id); 0127 $user = array( 0128 "username" => $identity->username, 0129 "member_id" => $identity->member_id, 0130 "mail" => $identity->mail, 0131 "avatar" => $avatar, 0132 "roleName" =>$identity->roleName, 0133 "isSupporter" => $isSupporter 0134 ); 0135 0136 $settingmodel = new Default_Model_MemberSettingValue(); 0137 $result = $settingmodel->fetchMemberSettingItem($identity->member_id,1); 0138 if($result && $result['value']==1) 0139 { 0140 $metamenuTheme = 'metamenu-theme-dark'; 0141 } 0142 $result = $settingmodel->fetchMemberSettingItem($identity->member_id,2); 0143 if($result && $result['value']==1) 0144 { 0145 $contentTheme = 'content-theme-dark'; 0146 } 0147 0148 0149 } 0150 0151 $sname = Zend_Registry::get('store_host'); 0152 $json_menu = $this->fetchStoresForCatTreeJson(); 0153 0154 0155 $response = array( 0156 "isAdmin" => $isAdmin, 0157 "isExternal" => $is_external, 0158 "domains" => Zend_Json::decode($json_menu), 0159 "user" => $user, 0160 "baseUrl" => $baseurl, 0161 "baseUrlStore" => $baseurlStore, 0162 "searchbaseurl" => $searchbaseurl, 0163 "blogUrl" => $url_blog, 0164 "forumUrl" => $url_forum, 0165 "mastodonUrl" => $url_mastodon, 0166 "gitlabUrl" => $url_gitlab, 0167 "myopendesktopUrl" => $url_myopendesktop, 0168 "cloudopendesktopUrl" => $url_cloudopendesktop, 0169 "musicopendesktopUrl" => $url_musicopendesktop, 0170 "docsopendesktopUrl" => $url_docsopendesktop, 0171 "riotUrl" => $url_riot, 0172 "loginUrl" => $url_login, 0173 "logoutUrl" => $url_logout, 0174 "sName" => $sname, 0175 "metamenuTheme" => $metamenuTheme, 0176 "contentTheme" => $contentTheme, 0177 "target" => $targetObject, 0178 "store" => ($storeConfig?$storeConfig->name:null), 0179 "storeConfig" => array("config_id_name"=>$storeConfig->config_id_name,"name" =>$storeConfig->name), 0180 ); 0181 0182 ?> 0183 0184 <div id="metaheader"></div> 0185 <script type="text/javascript"> 0186 var config=<?=json_encode($response)?>; 0187 </script> 0188 0189 <script src="/theme/react/bundle/metaheader-local-bundle.js?<?= APPLICATION_VERSION ?>"></script> 0190