Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit b766d8a

Browse files
author
Charles Marion
committed
BUG: Fixed helloworld plugin
1 parent e0d5f9c commit b766d8a

File tree

6 files changed

+23
-28
lines changed

6 files changed

+23
-28
lines changed

core/controllers/AdminController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ function upgradeAction()
276276
}
277277
else
278278
{
279-
echo JsonComponent::encode(array(true, 'Nothing to upgrade'));
279+
echo JsonComponent::encode(array(false, 'Nothing to upgrade'));
280280
}
281281
return;
282282
}

core/public/js/admin/admin.index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
$(document).ready(function() {
22

3+
4+
35
tabs=$( "#tabsGeneric" ).tabs({
46
});
57
$("#tabsGeneric").show();

core/public/js/admin/admin.upgrade.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ function successUpgrade(responseText, statusText, xhr, form)
2121
}
2222
if(jsonResponse[0])
2323
{
24-
tabs.tabs( "load" , 1);
2524
createNotive(jsonResponse[1],4000);
25+
window.location.reload()
2626
}
2727
else
2828
{

modules/helloworld/layouts/layout.phtml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@
6767
<ul>
6868
<li class="first">
6969
<?php
70-
if($this->logged)
70+
if($this->logged&&isset($this->userDao))
7171
{
7272
echo '
7373
<b><a id="topUserName" href="'.$this->webroot.'/user/'.$this->userDao->getUserId().'" >'.$this->userDao->getFullName().' <img class="arrowUser" src="'.$this->coreWebroot.'/public/images/icons/arrow-user.gif" alt ="" /> </a> </b>
7474
<ul>
7575
<li onclick="location.replace(\''.$this->webroot.'/user/userpage\');"><a>'.$this->t('My Page').'</a></li>
7676
<li class="myAccountLink"><a>'.$this->t('My Account').'</a></li>
77-
<li class="modulesLink"><a>'.$this->t('Modules').'</a></li>';
77+
';
7878
if($this->userDao->isAdmin())
7979
{
8080
echo '
@@ -123,15 +123,13 @@
123123
</div>
124124
<div class="Header">
125125
<div class="HeaderContent">
126-
126+
Hello Plugin !!!
127127
<div class="HeaderLogo" onclick="window.location='<?php echo $this->webroot?>';">
128-
Hello Plugin !!!
129128
</div>
130129
<div class="HeaderSearch">
131130
<input type="text" id="live_search" value="<?= $this->t('Jump to a data, folder...') ?>" autocomplete="off" autocorrect="off" autocapitalize="off" />
132131
<input type="hidden" id="live_search_value" value="init" />
133132
<div id="searchloading" style="display:none"></div>
134-
<a id="advancedSearchLink"><?php echo $this->t('Advanced search')?></a>
135133
</div>
136134
<div class="HeaderAction">
137135
<ul>
@@ -145,16 +143,23 @@
145143
</div>
146144
</div>
147145
</div>
146+
148147
<div class="Wrapper">
148+
<?php
149+
if($this->needUpgrade)
150+
{
151+
echo '<span style="color:red;">MIDAS need to be upgraded. <a href="'.$this->webroot.'/admin/#ui-tabs-1">Upgrade</a></span><br/><br/>';
152+
}
153+
?>
149154
<div class=SubWrapper">
155+
150156
<div class="MainContent">
151157
<div class="SideBar">
152158
<ul>
153159
<li <?php if($this->activemenu=='feed') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/feed');" ><a href="<?php echo $this->webroot?>/feed"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/feed.png" /><span> <?php echo $this->t('Feed');?></span></a></li>
154160
<li <?php if($this->activemenu=='browse') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/browse');" ><a href="<?php echo $this->webroot?>/browse"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/data.png" /><span> <?php echo $this->t('Data');?></span></a></li>
155161
<li <?php if($this->activemenu=='community') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/community');" ><a href="<?php echo $this->webroot?>/community"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/community.png" /><span> <?php echo $this->t('Communities');?></span></a></li>
156162
<li id="menuUserInfo" <?php if($this->activemenu=='user') {echo 'class="active"';} ?> ><a href="javascript:;"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/upload.png" /><span> <?php echo $this->t('My Uploads');?></span></a></li>
157-
<li <?php if($this->activemenu=='plugin') {echo 'class="active"';} ?> class="last"><a href="#"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/plugin.png" /><span> <?php echo $this->t('Plugins');?></span></a></li>
158163
</ul>
159164
<hr/>
160165
<?php
@@ -165,7 +170,10 @@
165170
echo '<ul>';
166171
foreach ($recentReverse as $item)
167172
{
168-
echo "<li onclick=\"location.replace('{$this->webroot}/item/{$item->getKey()}');\" class='recentItem' title='". str_replace("'", '"', $item->getName())." | todo'><a href='{$this->webroot}/item/{$item->getKey()}'>".sliceRecentItem($item->getName())."</a></li>";
173+
if(is_array($item))
174+
{
175+
echo "<li onclick=\"location.replace('{$this->webroot}/item/{$item['item_id']}');\" class='recentItem' title='". str_replace("'", '"', $item['name'])." | todo'><a href='{$this->webroot}/item/{$item['item_id']}'>".$this->slicename($item['name'],20)."</a></li>";
176+
}
169177
}
170178
echo '</ul>';
171179
}
@@ -216,15 +224,4 @@
216224
<?php echo $this->json?>
217225
</div>
218226
</body>
219-
</html>
220-
221-
<?php
222-
function sliceRecentItem($name)
223-
{
224-
if(strlen($name)>20)
225-
{
226-
$name=substr($name,0, 6).'...'.substr($name,strlen($name)-11);
227-
}
228-
return $name;
229-
}
230-
?>
227+
</html>

modules/ldap/Notification.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ private function ldapLogin($params)
4141
$proxyPassword = $config['ldap']->ldap->proxyPassword;
4242
$passwordPrefix=Zend_Registry::get('configGlobal')->password->prefix;
4343

44-
$ldapsearch = 'uid='.substr($email,0,strpos($email,'@'));
45-
if($searchTerm == 'mail')
46-
{
47-
$ldapsearch = 'mail='.$email;
48-
}
44+
$ldapsearch = $searchTerm.'='.$email;
4945

5046
$ldap = ldap_connect($hostname);
5147
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $protocolVersion);

modules/ldap/controllers/ConfigController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ function indexAction()
4242
{
4343
if(file_exists(BASE_PATH."/core/configs/ldap.local.ini.old"))
4444
{
45-
unlink(BASE_PATH.'/modules/ldap/configs/module.local.ini.old');
45+
unlink(BASE_PATH."/core/configs/ldap.local.ini.old");
4646
}
4747
if(file_exists(BASE_PATH."/core/configs/ldap.local.ini"))
4848
{
49-
rename(BASE_PATH."/core/configs/ldap.local.ini", BASE_PATH.'/modules/ldap/configs/module.local.ini.old');
49+
rename(BASE_PATH."/core/configs/ldap.local.ini",BASE_PATH."/core/configs/ldap.local.ini.old");
5050
}
5151
$applicationConfig['global']['ldap.hostname'] = $this->_getParam('hostname');
5252
$applicationConfig['global']['ldap.basedn'] = '"'.$this->_getParam('basedn').'"';

0 commit comments

Comments
 (0)