File indexing completed on 2024-12-29 05:24:37

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 $auth = Zend_Auth::getInstance();
0024 $getAuthUser = new Default_View_Helper_GetAuthUser();
0025 $member = $getAuthUser->getAuthUser();
0026 
0027 $formLogin = new Default_Form_Login();
0028 $formLogin->setName('login_header');
0029 
0030 $helperBuildMemberUrl = new Default_View_Helper_BuildMemberUrl();
0031 $helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl();
0032 $helperEncryptUrl = new Default_View_Helper_EncryptUrl();
0033 
0034 if (false === $auth->hasIdentity() || empty($member->username)) { ?>
0035     <li class="link profile-menu-nologin">
0036         <a href="/register" rel="nofollow">
0037             <span>Join</span>
0038         </a>
0039     </li>
0040     <li class="link-partial last-link">
0041         <a href="/login?redirect=<?= $helperEncryptUrl->encryptUrl(Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(), true) ?>"
0042            id="login-dropdown" onclick="return false;" rel="nofollow">
0043             <span>Login</span>
0044         </a>
0045 
0046         <div class="header-login-container">
0047             <div class="header-login-form">
0048                 <div class="form-top">
0049                     <h3 class="report-heading lightblue"><?= $this->translate('Log in to your account') ?></h3>
0050                 </div>
0051                 <div class="form-body">
0052                     <form action="<?= $formLogin->getAction(); ?>"
0053                           method="<?= $formLogin->getMethod(); ?>">
0054                         <?= $formLogin->redirect ?>
0055                         <?= $formLogin->dologin ?>
0056                         <?= $formLogin->mail ?>
0057                         <?= $formLogin->password ?>
0058                         <?= $formLogin->remember_me ?>
0059                         <?= $formLogin->login ?>
0060                     </form>
0061                     <a href="/login/forgot" class="lightblue small" rel="nofollow">Forgot your password?</a>
0062                 </div>
0063                 <div class="form-footer">
0064                     <p><?= $this->translate('Or you can login with one of the following') ?></p>
0065 
0066                     <div class="social">
0067                         <a href="/login/facebook" class="facebook" rel="nofollow"><i
0068                                 class="icon-facebook"></i></a>
0069                         <a href="/login/twitter" class="twitter" rel="nofollow"><i
0070                                 class="icon-twitter"></i></a>
0071                     </div>
0072                 </div>
0073             </div>
0074         </div>
0075     </li>
0076 <?php } ?>
0077 <?php if ($auth->hasIdentity() && !empty($member->username)) { ?>
0078     <li class="link relative profile-menu-container">
0079         <div class="absolute header-profile-image"><img
0080                 src="<?= $this->Image($member->profile_image_url, array('width' => 30, 'height' => 30)) ?>"/>
0081         </div>
0082         <a rel="profile-menu" class="menu-trigger"><span><?= $member->username ?></span></a>
0083         <ul class="profile-menu menu-dropdown">
0084             <div class="dropdown-header"></div>
0085             <li class="link first"><a
0086                     href="<?= $helperBuildMemberUrl->buildMemberUrl($member->username, 'products') ?>"><?= $this->translate('My Products') ?></a>
0087             </li>
0088             <li class="link">
0089                 <a href="/settings/"><?= $this->translate('My Settings') ?></a>
0090             </li>
0091             <li class="link"><a href="/logout/"><?= $this->translate('Logout') ?></a>
0092             </li>
0093         </ul>
0094     </li>
0095 <?php } ?>