User management implemented
This commit is contained in:
parent
867faadb9a
commit
61e1d47c97
27 changed files with 670 additions and 404 deletions
|
@ -5,6 +5,7 @@ $Smarty->register_object('SEARCH', $uiBrowser->SEARCH);
|
||||||
$Smarty->assign_by_ref ('PL', $uiBrowser->PLAYLIST);
|
$Smarty->assign_by_ref ('PL', $uiBrowser->PLAYLIST);
|
||||||
$Smarty->assign_by_ref ('SCHEDULER', $uiBrowser->SCHEDULER);
|
$Smarty->assign_by_ref ('SCHEDULER', $uiBrowser->SCHEDULER);
|
||||||
$Smarty->assign_by_ref ('SCRATCHPAD', $uiBrowser->SCRATCHPAD);
|
$Smarty->assign_by_ref ('SCRATCHPAD', $uiBrowser->SCRATCHPAD);
|
||||||
|
$Smarty->assign_by_ref ('SUBJECTS', $uiBrowser->SUBJECTS);
|
||||||
|
|
||||||
$Smarty->register_function('str_repeat', 'S_str_repeat');
|
$Smarty->register_function('str_repeat', 'S_str_repeat');
|
||||||
$Smarty->register_function('urlencode', 'S_urlencode');
|
$Smarty->register_function('urlencode', 'S_urlencode');
|
||||||
|
|
121
livesupport/modules/htmlUI/var/formmask/subjects.php
Executable file
121
livesupport/modules/htmlUI/var/formmask/subjects.php
Executable file
|
@ -0,0 +1,121 @@
|
||||||
|
<?php
|
||||||
|
$mask = array(
|
||||||
|
'addUser' => array(
|
||||||
|
array(
|
||||||
|
'element' => 'act',
|
||||||
|
'type' => 'hidden',
|
||||||
|
'constant' => 'SUBJECTS.addSubj'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'login',
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => 'Login',
|
||||||
|
'required' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'passwd',
|
||||||
|
'type' => 'password',
|
||||||
|
'label' => 'Password',
|
||||||
|
'required' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'passwd2',
|
||||||
|
'type' => 'password',
|
||||||
|
'label' => 'Repeat password',
|
||||||
|
'required' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'cancel',
|
||||||
|
'type' => 'button',
|
||||||
|
'label' => 'Cancel',
|
||||||
|
'attributes'=> array('onClick' => 'location.href="'.UI_BROWSER.'?act=SUBJECTS"'),
|
||||||
|
'groupit' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'Submit',
|
||||||
|
'type' => 'submit',
|
||||||
|
'label' => 'Submit',
|
||||||
|
'groupit' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'group' => array('cancel', 'Submit')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
|
'addGroup' => array(
|
||||||
|
array(
|
||||||
|
'element' => 'act',
|
||||||
|
'type' => 'hidden',
|
||||||
|
'constant' => 'SUBJECTS.addSubj'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'login',
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => 'Groupname',
|
||||||
|
'required' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'cancel',
|
||||||
|
'type' => 'button',
|
||||||
|
'label' => 'Cancel',
|
||||||
|
'attributes'=> array('onClick' => 'location.href="'.UI_BROWSER.'?act=SUBJECTS"'),
|
||||||
|
'groupit' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'Submit',
|
||||||
|
'type' => 'submit',
|
||||||
|
'label' => 'Submit',
|
||||||
|
'groupit' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'group' => array('cancel', 'Submit')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
|
'chgPasswd' => array(
|
||||||
|
array(
|
||||||
|
'element' => 'act',
|
||||||
|
'type' => 'hidden',
|
||||||
|
'constant' => 'SUBJECTS.chgPasswd'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'login',
|
||||||
|
'type' => 'hidden'
|
||||||
|
),
|
||||||
|
'oldpasswd' => array(
|
||||||
|
'element' => 'oldpasswd',
|
||||||
|
'type' => 'password',
|
||||||
|
'label' => 'Old password',
|
||||||
|
'required' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'passwd',
|
||||||
|
'type' => 'password',
|
||||||
|
'label' => 'Password',
|
||||||
|
'required' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'passwd2',
|
||||||
|
'type' => 'password',
|
||||||
|
'label' => 'Repeat password',
|
||||||
|
'required' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'cancel',
|
||||||
|
'type' => 'button',
|
||||||
|
'label' => 'Cancel',
|
||||||
|
'attributes'=> array('onClick' => 'location.href="'.UI_BROWSER.'?act=SUBJECTS"'),
|
||||||
|
'groupit' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'element' => 'Submit',
|
||||||
|
'type' => 'submit',
|
||||||
|
'label' => 'Submit',
|
||||||
|
'groupit' => TRUE
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'group' => array('cancel', 'Submit')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
?>
|
|
@ -81,6 +81,11 @@ if (is_array($_REQUEST['popup'])){
|
||||||
$Smarty->assign('scheduleId', $_REQUEST['scheduleId']);
|
$Smarty->assign('scheduleId', $_REQUEST['scheduleId']);
|
||||||
$Smarty->display('popup/SCHEDULER.removeItem.tpl');
|
$Smarty->display('popup/SCHEDULER.removeItem.tpl');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.confirmRemoveSubj":
|
||||||
|
$Smarty->assign('lgoin', $_REQUEST['login']);
|
||||||
|
$Smarty->display('popup/SUBJECTS.confirmRemoveSubj.tpl');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
die();
|
die();
|
||||||
|
@ -139,28 +144,6 @@ if ($uiBrowser->userid) {
|
||||||
$Smarty->assign('showLibrary', TRUE);
|
$Smarty->assign('showLibrary', TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "subjects":
|
|
||||||
case "addUser":
|
|
||||||
case "addGroup":
|
|
||||||
$Smarty->assign('subjects', $uiBrowser->getSubjects());
|
|
||||||
switch($_REQUEST['act']) {
|
|
||||||
case "addUser": $Smarty->assign('addSubjectForm', $uiBrowser->getAddSubjectForm($ui_fmask['addUser'])); break;
|
|
||||||
case "addGroup": $Smarty->assign('addSubjectForm', $uiBrowser->getAddSubjectForm($ui_fmask['addGroup'])); break;
|
|
||||||
}
|
|
||||||
$Smarty->assign('showSubjects', TRUE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "chgPasswd":
|
|
||||||
$Smarty->assign('chgPasswd', $uiBrowser->chgPasswd($_REQUEST['uid'], $ui_fmask['chgPasswd']));
|
|
||||||
$Smarty->assign('showSubjects', TRUE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "groupMembers":
|
|
||||||
$Smarty->assign('groupMembers', $uiBrowser->groupMembers($uiBrowser->id));
|
|
||||||
$Smarty->assign('addGroupMember', $uiBrowser->addGroupMember($uiBrowser->id));
|
|
||||||
$Smarty->assign('showSubjects', TRUE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "getFile":
|
case "getFile":
|
||||||
$Smarty->assign('fData', $uiBrowser->getFile($uiBrowser->id));
|
$Smarty->assign('fData', $uiBrowser->getFile($uiBrowser->id));
|
||||||
$Smarty->assign('showFile', TRUE);
|
$Smarty->assign('showFile', TRUE);
|
||||||
|
@ -195,6 +178,17 @@ if ($uiBrowser->userid) {
|
||||||
case "SCHEDULER":
|
case "SCHEDULER":
|
||||||
$Smarty->assign('showScheduler', TRUE);
|
$Smarty->assign('showScheduler', TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case "SUBJECTS":
|
||||||
|
case "SUBJECTS.manageGroupMember":
|
||||||
|
case "SUBJECTS.addUser":
|
||||||
|
case "SUBJECTS.addGroup":
|
||||||
|
case "SUBJECTS.remSubj":
|
||||||
|
case "SUBJECTS.chgPasswd":
|
||||||
|
$Smarty->assign('showSubjects', TRUE);
|
||||||
|
$Smarty->assign('act', $_REQUEST['act']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST['act'] != 'SCHEDULER')
|
if ($_REQUEST['act'] != 'SCHEDULER')
|
||||||
|
|
|
@ -73,22 +73,6 @@ switch($_REQUEST['act']){
|
||||||
$uiHandler->SCRATCHPAD->removeItems($uiHandler->id);
|
$uiHandler->SCRATCHPAD->removeItems($uiHandler->id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "addUser":
|
|
||||||
$uiHandler->addSubj($_REQUEST, $ui_fmask["addUser"]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "addGroup":
|
|
||||||
$uiHandler->addSubj($_REQUEST, $ui_fmask["addGroup"]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "removeSubj":
|
|
||||||
$uiHandler->removeSubj($_REQUEST["login"]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "chgPasswd":
|
|
||||||
$uiHandler->chgPasswd($_REQUEST["uid"], $_REQUEST["oldpass"], $_REQUEST["pass"], $_REQUEST["pass2"]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "addPerm":
|
case "addPerm":
|
||||||
$uiHandler->addPerm($_REQUEST["subj"], $_REQUEST["permAction"], $uiHandler->id, $_REQUEST["allowDeny"]);
|
$uiHandler->addPerm($_REQUEST["subj"], $_REQUEST["permAction"], $uiHandler->id, $_REQUEST["allowDeny"]);
|
||||||
break;
|
break;
|
||||||
|
@ -97,12 +81,25 @@ switch($_REQUEST['act']){
|
||||||
$uiHandler->removePerm($_REQUEST["permid"], $_REQUEST["oid"]);
|
$uiHandler->removePerm($_REQUEST["permid"], $_REQUEST["oid"]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "addGroupMember":
|
## SUBJECTS
|
||||||
$uiHandler->addSubj2Group($_REQUEST);
|
case "SUBJECTS.addSubj":
|
||||||
|
$uiHandler->SUBJECTS->addSubj($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "removeGroupMember":
|
case "SUBJECTS.removeSubj":
|
||||||
$uiHandler->removeGroupMember($_REQUEST);
|
$uiHandler->SUBJECTS->removeSubj($_REQUEST);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.addSubj2Group":
|
||||||
|
$uiHandler->SUBJECTS->addSubj2Group($_REQUEST);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.removeSubjFromGr":
|
||||||
|
$uiHandler->SUBJECTS->removeSubjFromGr($_REQUEST);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.chgPasswd":
|
||||||
|
$uiHandler->SUBJECTS->chgPasswd($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "changeStationPrefs":
|
case "changeStationPrefs":
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $showSubjects}
|
{if $showSubjects}
|
||||||
{include file="subjects.tpl"}
|
{include file="subjects/main.tpl"}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $showFile}
|
{if $showFile}
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $changeStationPrefs}
|
{if $changeStationPrefs}
|
||||||
{include file="stationprefs.tpl"}
|
{include file="system/stationprefs.tpl"}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $PL_simpleManagement}
|
{if $PL_simpleManagement}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<!-- start nav -->
|
<!-- start nav -->
|
||||||
<div class="container_nav">
|
<div class="container_nav">
|
||||||
<ul id="nav">
|
<ul id="nav">
|
||||||
<!-- <li><a href="{$UI_BROWSER}?id={$START.fid}&act=uploadFileM">UploadM</a></li> -->
|
|
||||||
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=editFile">##Add Audio##</a>
|
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=editFile">##Add Audio##</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=editFile">##File##</a></li>
|
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=editFile">##File##</a></li>
|
||||||
|
@ -16,16 +15,16 @@
|
||||||
</li>
|
</li>
|
||||||
<li><a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">##Playlist Editor##</a></li>
|
<li><a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">##Playlist Editor##</a></li>
|
||||||
<li><a href="{$UI_BROWSER}?act=SCHEDULER">##Scheduler##</a></li>
|
<li><a href="{$UI_BROWSER}?act=SCHEDULER">##Scheduler##</a></li>
|
||||||
<!-- <li><a href="{$UI_BROWSER}?act=MetaDataValues&Main=1">Metadata</a></li> -->
|
|
||||||
<li><a href="{$UI_BROWSER}?act=changeStationPrefs">##Station Settings##</a>
|
|
||||||
|
|
||||||
|
{if $USER.login == 'root'}
|
||||||
|
<li><a href="{$UI_BROWSER}?act=changeStationPrefs">##Station Settings##</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{$UI_BROWSER}?act=changeStationPrefs">##Station Settings##</a></li>
|
<li><a href="{$UI_BROWSER}?act=changeStationPrefs">##Station Settings##</a></li>
|
||||||
<li><a href="{$UI_BROWSER}?id={$START.id}&act=subjects">##User/Groups##</a></li>
|
<li><a href="{$UI_BROWSER}?act=SUBJECTS">##User/Groups##</a></li>
|
||||||
<li><a href="{$UI_BROWSER}?act=fileList&id={$START.fid}">##File List##</a></li>
|
<li><a href="{$UI_BROWSER}?act=fileList&id={$START.fid}">##File List##</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
{/if}
|
||||||
<li><a href="#" onClick="window.open('help.html','','scrollbars=yes,resizable=yes,width=500,height=400')">##Help##</a></li>
|
<li><a href="#" onClick="window.open('help.html','','scrollbars=yes,resizable=yes,width=500,height=400')">##Help##</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="head" style="width: 574px;">
|
<div class="head" style="width: 574px;">
|
||||||
<div class="left"> </div>
|
<div class="left"> </div>
|
||||||
<div class="right"> </div>
|
<div class="right"> </div>
|
||||||
<div class="clearer"></div>
|
<div class="clearer"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container_table" style="width: 594px;">
|
<div class="container_table" style="width: 594px;">
|
||||||
<table style="width: 574px;">
|
<table style="width: 574px;">
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
{foreach from=$PL->getFlat() key='pos' item='i'}
|
{foreach from=$PL->getFlat() key='pos' item='i'}
|
||||||
<!-- {$n++} -->
|
<!-- {$n++} -->
|
||||||
<!-- fade information -->
|
<!-- fade information -->
|
||||||
<tr onClick="return contextmenu('{$i.attrs.id}', {if $n == 1}'PL.changeFadeIn'{else}'PL.changeTransition'{/if})}" style="background-color: #bbb">
|
<tr onClick="return contextmenu('{$i.attrs.id}', {if $n == 1}'PL.changeFadeIn'{else}'PL.changeTransition'{/if})" style="background-color: #bbb">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="5" style="border: 0">##Fade## {$i.fadein_ms|string_format:"%d"} ms</td>
|
<td colspan="5" style="border: 0">##Fade## {$i.fadein_ms|string_format:"%d"} ms</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{if $n}
|
{if $n}
|
||||||
<!-- fade information -->
|
<!-- fade information -->
|
||||||
<tr onClick="return contextmenu('{$i.attrs.id}', {if $n == 1}'PL.changeFadeIn'{else}'PL.changeFadeOut'{/if})}" style="background-color: #bbb">
|
<tr onClick="return contextmenu('{$i.attrs.id}', {if $n == 1}'PL.changeFadeIn'{else}'PL.changeFadeOut'{/if})" style="background-color: #bbb">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="5" style="border: 0">##Fade## {$i.fadeout_ms|string_format:"%d"} ms</td>
|
<td colspan="5" style="border: 0">##Fade## {$i.fadeout_ms|string_format:"%d"} ms</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -32,18 +32,18 @@ function SCHEDULE_submit()
|
||||||
function SCHEDULE_snap2Hour()
|
function SCHEDULE_snap2Hour()
|
||||||
{
|
{
|
||||||
{/literal}
|
{/literal}
|
||||||
document.forms["schedule"].elements["time[H]"].value = {$SCHEDULER->scheduleAt.hour};
|
document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->scheduleAt.hour}";
|
||||||
document.forms["schedule"].elements["time[i]"].value = 0;
|
document.forms["schedule"].elements["time[i]"].value = "0";
|
||||||
document.forms["schedule"].elements["time[s]"].value = 0;
|
document.forms["schedule"].elements["time[s]"].value = "0";
|
||||||
{literal}
|
{literal}
|
||||||
}
|
}
|
||||||
|
|
||||||
function SCHEDULE_snap2Prev()
|
function SCHEDULE_snap2Prev()
|
||||||
{
|
{
|
||||||
{/literal}
|
{/literal}
|
||||||
document.forms["schedule"].elements["time[H]"].value = {$SCHEDULER->schedulePrev.hour};
|
document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->schedulePrev.hour}";
|
||||||
document.forms["schedule"].elements["time[i]"].value = {$SCHEDULER->schedulePrev.minute};
|
document.forms["schedule"].elements["time[i]"].value = "{$SCHEDULER->schedulePrev.minute}";
|
||||||
document.forms["schedule"].elements["time[s]"].value = {$SCHEDULER->schedulePrev.second};
|
document.forms["schedule"].elements["time[s]"].value = "{$SCHEDULER->schedulePrev.second}";
|
||||||
{literal}
|
{literal}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,13 +79,6 @@ function SCHEDULE_selectedGunid()
|
||||||
var arr = document.forms["schedule"].elements["gunid_duration"].value.split("|");
|
var arr = document.forms["schedule"].elements["gunid_duration"].value.split("|");
|
||||||
return arr[0];
|
return arr[0];
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
date1 = new Date("january 01, 1970 00:00:10");
|
|
||||||
date2 = new Date("january 01, 1970 00:00:33");
|
|
||||||
date3 = new Date();
|
|
||||||
date3.setTime(date1.getTime() + date2.getTime());
|
|
||||||
alert(date3.getSeconds());
|
|
||||||
*/
|
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{include file="popup/header.tpl"}
|
||||||
|
|
||||||
|
<center>
|
||||||
|
{tra 0='Are you sure to remove "$1"?' 1=$_REQUEST.login}
|
||||||
|
<br><br>
|
||||||
|
<input type="button" class="button" onClick="window.close()" value="Cancel">
|
||||||
|
<input type="button" class="button" onClick="location.href='{$UI_HANDLER}?act=SUBJECTS.removeSubj&login={urlencode str=$_REQUEST.login}'" value="OK">
|
||||||
|
</center>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -25,12 +25,11 @@ onClick="hidealttextnow(); return contextmenu('{$i.id}'
|
||||||
{if $_PL_activeId}
|
{if $_PL_activeId}
|
||||||
{if $_PL_activeId == $i.id}
|
{if $_PL_activeId == $i.id}
|
||||||
, 'PL.release'
|
, 'PL.release'
|
||||||
{elseif $PL->isAvailable($i.id) == TRUE}
|
{elseif $PL->isAvailable($i.id) == true}
|
||||||
, 'PL.addItem', 'delete'
|
, 'PL.addItem', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{elseif $PL->isAvailable($i.id) == TRUE}
|
{elseif $PL->isAvailable($i.id) == true}
|
||||||
, 'PL.activate', 'PL.create', 'delete'
|
, 'PL.activate', 'PL.create', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
)"
|
)"
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<tr class="{cycle values='blue1, blue2'}">
|
<tr class="{cycle values='blue1, blue2'}">
|
||||||
<td><input type="checkbox" class="checkbox" name="{$i.id}"/></td>
|
<td><input type="checkbox" class="checkbox" name="{$i.id}"/></td>
|
||||||
<td {include file="scratchpad/actionhandler.tpl"}>
|
<td {include file="scratchpad/actionhandler.tpl"}>
|
||||||
{if $i.type == "playlist"}
|
{if $i.type|lower == "playlist"}
|
||||||
{if $PL->isAvailable($i.id) == FALSE}
|
{if $PL->isAvailable($i.id) == FALSE}
|
||||||
<div style="text-decoration : line-through">
|
<div style="text-decoration : line-through">
|
||||||
{else}
|
{else}
|
||||||
|
@ -35,10 +35,10 @@
|
||||||
{else}
|
{else}
|
||||||
<div>
|
<div>
|
||||||
{/if}
|
{/if}
|
||||||
{$i.title|truncate:12}
|
{$i.title|truncate:12:'...':true}
|
||||||
</div></div>
|
</div></div>
|
||||||
{else}
|
{else}
|
||||||
{$i.title|truncate:12}
|
{$i.title|truncate:12:'...':true}
|
||||||
{/if} {* on some reason object call doesn´t like usage of array *}
|
{/if} {* on some reason object call doesn´t like usage of array *}
|
||||||
</td> {assign var="_duration" value=$i.duration}
|
</td> {assign var="_duration" value=$i.duration}
|
||||||
<td {include file="scratchpad/actionhandler.tpl"}>{niceTime in=$_duration}</td>
|
<td {include file="scratchpad/actionhandler.tpl"}>{niceTime in=$_duration}</td>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
document.write('<div id="alttextContainer"></div>');
|
document.write('<div id="alttextContainer"></div>');
|
||||||
alttextWidth = 200;
|
alttextWidth = 200;
|
||||||
alttextHeight = 0;
|
alttextHeight = 0;
|
||||||
|
alttextduration = 0;
|
||||||
|
|
||||||
function showalttext(param) {
|
function showalttext(param) {
|
||||||
var alttextHeader = "<div class='alttext' id='alttext' style='position: absolute; top: -1000; left: 0; z-index: 99'>";
|
var alttextHeader = "<div class='alttext' id='alttext' style='position: absolute; top: -1000; left: 0; z-index: 99'>";
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
alttexthide = false;
|
alttexthide = false;
|
||||||
setTimeout("showalttextnow("+xPos+", "+yPos+")", 1000);
|
setTimeout("showalttextnow("+xPos+", "+yPos+")", alttextduration);
|
||||||
document.onmouseover = null;
|
document.onmouseover = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -53,7 +54,7 @@
|
||||||
|
|
||||||
function hidealttext() {
|
function hidealttext() {
|
||||||
alttexthide = true;
|
alttexthide = true;
|
||||||
setTimeout("hidealttextnow()", 1000);
|
setTimeout("hidealttextnow()", alttextduration);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hidealttextnow() {
|
function hidealttextnow() {
|
||||||
|
|
|
@ -100,6 +100,27 @@
|
||||||
case "SCHEDULER.removeItem":
|
case "SCHEDULER.removeItem":
|
||||||
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='#' onClick=\"popup('{$UI_BROWSER}?popup[]=SCHEDULER.removeItem&"+param+"', 'Schedule', 400, 50)\"')"+oF+"> ##Remove Playlist## </a></li>";
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='#' onClick=\"popup('{$UI_BROWSER}?popup[]=SCHEDULER.removeItem&"+param+"', 'Schedule', 400, 50)\"')"+oF+"> ##Remove Playlist## </a></li>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.chgPasswd":
|
||||||
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='{$UI_BROWSER}?act=SUBJECTS.chgPasswd&"+param+"' "+oF+"> ##Change password## </a></li>";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.manageGroupMember":
|
||||||
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='{$UI_BROWSER}?act=SUBJECTS.manageGroupMember&"+param+"' "+oF+"> ##Manage group members## </a></li>";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.addSubj2Group":
|
||||||
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='#' onClick=\"hpopup('{$UI_HANDLER}?act=SUBJECTS.addSubj2Group&"+param+"')\" "+oF+"> ##Add to group## </a></li>";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.removeSubjFromGr":
|
||||||
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='#' onClick=\"hpopup('{$UI_HANDLER}?act=SUBJECTS.removeSubjFromGr&"+param+"')\" "+oF+"> ##Remove from group## </a></li>";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SUBJECTS.removeSubj":
|
||||||
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='#' onClick=\"popup('{$UI_BROWSER}?popup[]=SUBJECTS.confirmRemoveSubj&"+param+"', 'confirmRemoveSubj', 400, 50)\"')"+oF+"> ##Delete## </a></li>";
|
||||||
|
break;
|
||||||
|
|
||||||
{literal}
|
{literal}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
{* Smarty template *}
|
|
||||||
<div id="subjects">
|
|
||||||
{include file="sub/x.tpl"}
|
|
||||||
|
|
||||||
{if $chgPasswd}
|
|
||||||
{$chgPasswd}
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if $groupMembers}
|
|
||||||
<table id="tree" border="0" cellpadding="5">
|
|
||||||
<tr><th colspan="5">Subjects in group {$groupMembers.gname}</th></tr>
|
|
||||||
|
|
||||||
{if (is_array($groupMembers.rows) && count($groupMembers.rows)>0)}
|
|
||||||
{foreach from=$groupMembers.rows item=row}
|
|
||||||
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
|
|
||||||
<td>{$row.id}</td>
|
|
||||||
<td class="b">
|
|
||||||
{if ($row.type=='G')}
|
|
||||||
<a href="{$UI_BROWSER}?act=addsubj2group&id={$row.id}">{$row.login}</a>
|
|
||||||
{else}
|
|
||||||
{$row.login}
|
|
||||||
{/if}
|
|
||||||
</td
|
|
||||||
<td>{if ($row.type=='G')}(G){else}(U){/if}</td>
|
|
||||||
<td>
|
|
||||||
<a href="{$UI_HANDLER}?act=removeGroupMember&login={urlencode str=$row.login}&gname={urlencode str=$groupMembers.gname}&reid={$groupMembers.id}">
|
|
||||||
[remove from Group]
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/foreach}
|
|
||||||
{else}
|
|
||||||
<tr class="odd"><td colspan="3">No Members</td></tr>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
</table>
|
|
||||||
<br>
|
|
||||||
{$addGroupMember}
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if $subjects}
|
|
||||||
<table width="100%" border="0" cellpadding="1">
|
|
||||||
<tr><th colspan="4">Subjects</th></tr>
|
|
||||||
<tr><th>id</th><th>Login</th><th>User/Group</th><td></td></tr>
|
|
||||||
|
|
||||||
{if (is_array($subjects.subj) && count($subjects.subj)>0)}
|
|
||||||
{foreach from=$subjects.subj item=c}
|
|
||||||
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
|
|
||||||
<td>{$c.id}</td>
|
|
||||||
<td class="b">
|
|
||||||
{if ($c.type eq 'G')}
|
|
||||||
<a href="{$UI_BROWSER}?act=groupMembers&id={$c.id}">{$c.login}</a>
|
|
||||||
{else}
|
|
||||||
{$c.login}
|
|
||||||
{/if}
|
|
||||||
</td
|
|
||||||
<td>
|
|
||||||
{if ($c.type == 'G')}
|
|
||||||
G: {$c.cnt}
|
|
||||||
{else}
|
|
||||||
(U)
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a class="lnkbutt" href="{$UI_HANDLER}?act=removeSubj&login={urlencode str=$c.login}">[remove]</a>
|
|
||||||
{if ($c.type != 'G')}
|
|
||||||
<a class="lnkbutt" href="{$UI_BROWSER}?act=chgPasswd&uid={urlencode str=$c.id}">[change Password]</a>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/foreach}
|
|
||||||
{else}
|
|
||||||
<tr><td>no subject</td></tr>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<div align="center">
|
|
||||||
<a href='{$UI_BROWSER}?act=addUser'>[Add User]</a>
|
|
||||||
|
|
||||||
<a href='{$UI_BROWSER}?act=addGroup'>[Add Group]</a>
|
|
||||||
<br><br>
|
|
||||||
{$addSubjectForm}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
</div>
|
|
18
livesupport/modules/htmlUI/var/templates/subjects/addSubjForm.tpl
Executable file
18
livesupport/modules/htmlUI/var/templates/subjects/addSubjForm.tpl
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
{if $act == "SUBJECTS.addUser"}
|
||||||
|
{assign var="dynform" value=$SUBJECTS->getAddSubjForm('addUser')}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $act == "SUBJECTS.addGroup"}
|
||||||
|
{assign var="dynform" value=$SUBJECTS->getAddSubjForm('addGroup')}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<div class="container_elements" style="width: 607px;">
|
||||||
|
{if $act == 'SUBJECTS.addUser'}
|
||||||
|
<h1>##Add User##</h1>
|
||||||
|
{else}
|
||||||
|
<h1>##Add Group##</h1>
|
||||||
|
{/if}
|
||||||
|
{include file="sub/dynForm_plain.tpl"}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
6
livesupport/modules/htmlUI/var/templates/subjects/chgPasswd.tpl
Executable file
6
livesupport/modules/htmlUI/var/templates/subjects/chgPasswd.tpl
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
{assign var="dynform" value=$SUBJECTS->getChgPasswdForm($SUBJECTS->Base->gb->getSubjName($_REQUEST.id), false)}
|
||||||
|
|
||||||
|
<div class="container_elements" style="width: 607px;">
|
||||||
|
<h1>##Change Password for "{$SUBJECTS->Base->gb->getSubjName($_REQUEST.id)}"##</h1>
|
||||||
|
{include file="sub/dynForm_plain.tpl"}
|
||||||
|
</div>
|
18
livesupport/modules/htmlUI/var/templates/subjects/main.tpl
Executable file
18
livesupport/modules/htmlUI/var/templates/subjects/main.tpl
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
{if $act == "SUBJECTS"}
|
||||||
|
{include file="subjects/overview.tpl"}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $act == "SUBJECTS.addUser" || $act == "SUBJECTS.addGroup"}
|
||||||
|
{include file="subjects/addSubjForm.tpl"}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $act == "SUBJECTS.manageGroupMember"}
|
||||||
|
{include file="subjects/manageGroupMember.tpl"}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $act == "SUBJECTS.chgPasswd"}
|
||||||
|
{include file="subjects/chgPasswd.tpl"}
|
||||||
|
{/if}
|
||||||
|
</div>
|
87
livesupport/modules/htmlUI/var/templates/subjects/manageGroupMember.tpl
Executable file
87
livesupport/modules/htmlUI/var/templates/subjects/manageGroupMember.tpl
Executable file
|
@ -0,0 +1,87 @@
|
||||||
|
{assign var="_gname" value=$SUBJECTS->Base->gb->getSubjName($_REQUEST.id)}
|
||||||
|
|
||||||
|
<div class="container_elements" style="width: 607px;">
|
||||||
|
<h1>{tra 0='Manage Group: $1' 1=$_gname}</h1>
|
||||||
|
|
||||||
|
<div class="container_table" style="width: 594px;">
|
||||||
|
|
||||||
|
<!-- start current group member -->
|
||||||
|
<div class="container_elements" style="float: left">
|
||||||
|
<h1>##Current Members##</h1>
|
||||||
|
<div class="head" style="width:255px; height: 21px;"> </div>
|
||||||
|
<div class="container_table" style="width:275px;">
|
||||||
|
<table style="width:255px;">
|
||||||
|
<form name="GRP">
|
||||||
|
<tr class="blue_head">
|
||||||
|
<td style="width: 30px"><input type="checkbox" name="all" onClick="collector_switchAll('GRP')"></td>
|
||||||
|
<td style="width: 164px">##Name##</td>
|
||||||
|
<td style="width: 41px; border: 0">##Type##</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{assign var="_member" value=$SUBJECTS->getGroupMember($_REQUEST.id)}
|
||||||
|
{if (is_array($_member) && count($_member)>0)}
|
||||||
|
{foreach from=$_member item="i"}
|
||||||
|
<tr class="{cycle values='blue1, blue2'}"
|
||||||
|
onClick="return contextmenu('login={urlencode str=$i.login}&gname={urlencode str=$_gname}', 'SUBJECTS.removeSubjFromGr')">
|
||||||
|
<td><input type="checkbox" class="checkbox" name="{$i.id}"/></td>
|
||||||
|
<td>{$i.login}</td>
|
||||||
|
<td style="border: 0"><img src="img/{$i.type}.gif" border="0" alt="{$i.type|capitalize}" /></td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
{else}
|
||||||
|
<tr><td colspan="3" align="center" style="border: 0">##No group members##</td></tr>
|
||||||
|
{/if}
|
||||||
|
</form>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="footer" style="width:250px;">
|
||||||
|
<a href="" onClick="collector_submit('GRP', this.value)" id="blue_head">##Add selected##</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end current group member -->
|
||||||
|
|
||||||
|
<!-- start add group member -->
|
||||||
|
<div class="container_elements" style="float: right">
|
||||||
|
<h1>##Add Members##</h1>
|
||||||
|
<div class="head" style="width:255px; height: 21px;"> </div>
|
||||||
|
<div class="container_table" style="width:275px;">
|
||||||
|
<table style="width:255px;">
|
||||||
|
<form name="NOGRP">
|
||||||
|
<!-- start table header -->
|
||||||
|
<tr class="blue_head">
|
||||||
|
<td style="width: 30px"><input type="checkbox" name="all" onClick="collector_switchAll('NOGRP')"></td>
|
||||||
|
<td style="width: 164px">##Name##</td>
|
||||||
|
<td style="width: 41px; border: 0">##Type##</td>
|
||||||
|
</tr>
|
||||||
|
<!-- end table header -->
|
||||||
|
|
||||||
|
{assign var="_nonmember" value=$SUBJECTS->getNonGroupMember($_REQUEST.id)}
|
||||||
|
{foreach from=$_nonmember item=i}
|
||||||
|
{if $i.login !== $_gname}
|
||||||
|
{assign var="_loop" value=true}
|
||||||
|
<!-- start item -->
|
||||||
|
<tr class="{cycle values='blue1, blue2'}">
|
||||||
|
<td><input type="checkbox" class="checkbox" name="{$i.id}"/></td>
|
||||||
|
<td onClick="return contextmenu('login={urlencode str=$i.login}&gname={urlencode str=$_gname}', 'SUBJECTS.addSubj2Group')">{$i.login}</td>
|
||||||
|
<td style="border: 0"><img src="img/{$i.type}.gif" border="0" alt="{$i.type|capitalize}" /></td>
|
||||||
|
</tr>
|
||||||
|
<!-- end item -->
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
|
{if $_loop != true}
|
||||||
|
<tr><td colspan="3" align="center" style="border: 0">##Nothing left##</td></tr>
|
||||||
|
{/if}
|
||||||
|
</form>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="footer" style="width:250px;">
|
||||||
|
<a href="" onClick="collector_submit('GRP', this.value)" id="blue_head">##Add selected##</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end add group member -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="button" class="button" value="##Cancel##" onClick="location.href='{$UI_BROWSER}?act=SUBJECTS'">
|
||||||
|
</div>
|
||||||
|
|
39
livesupport/modules/htmlUI/var/templates/subjects/overview.tpl
Executable file
39
livesupport/modules/htmlUI/var/templates/subjects/overview.tpl
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
<div class="container_elements" style="width: 607px;">
|
||||||
|
<h1>##User/Group Management##</h1>
|
||||||
|
|
||||||
|
<div class="container_table" style="width: 594px;">
|
||||||
|
<table style="width: 574px;">
|
||||||
|
|
||||||
|
<tr class="blue_head">
|
||||||
|
<td style="width: 189px">##Name##</td>
|
||||||
|
<td style="width: 85px;">##Members##</td>
|
||||||
|
<td style="width: 85px; border: 0">##Type##</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{foreach from=$SUBJECTS->getSubjectsWCnt() item=i}
|
||||||
|
<tr class="{cycle values='blue1, blue2'}"
|
||||||
|
onClick="return contextmenu('id={$i.id}&login={urlencode str=$i.login}', {if $i.type|lower eq 'g'}'SUBJECTS.manageGroupMember', {else}'SUBJECTS.chgPasswd', {/if} 'SUBJECTS.removeSubj')"
|
||||||
|
>
|
||||||
|
<td>{$i.login}</td>
|
||||||
|
<td>
|
||||||
|
{if $i.type|lower == 'g'}
|
||||||
|
{$i.cnt}
|
||||||
|
{else}
|
||||||
|
-
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
<td style="border: 0"><img src="img/{$i.type|lower}.gif" border="0" alt="{$i.type|capitalize}" /></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<div class="container_button">
|
||||||
|
<input type="button" class="button" value="##Add User##" onclick="location.href='{$UI_BROWSER}?act=SUBJECTS.addUser'">
|
||||||
|
<input type="button" class="button" value="##Add Group##" onclick="location.href='{$UI_BROWSER}?act=SUBJECTS.addGroup'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
0
livesupport/modules/htmlUI/var/templates/stationprefs.tpl → livesupport/modules/htmlUI/var/templates/system/stationprefs.tpl
Executable file → Normal file
0
livesupport/modules/htmlUI/var/templates/stationprefs.tpl → livesupport/modules/htmlUI/var/templates/system/stationprefs.tpl
Executable file → Normal file
|
@ -1,9 +1,9 @@
|
||||||
{if $USER.userid}
|
{if $USER.userid}
|
||||||
<div class="loginname">##Signed in## : {$USER.login}</div>
|
<div class="loginname">##Signed in## : {$USER.login}</div>
|
||||||
<input type="button" class="button" value="{tra 0=logout}" onClick='javascript: popup("{$UI_BROWSER}?popup[]=logout", "name", "400", "50");'/>
|
<input type="button" class="button" value="##logout##" onClick='javascript: popup("{$UI_BROWSER}?popup[]=logout", "name", "400", "50");'/>
|
||||||
{*
|
{*
|
||||||
<input type="button" class="button" value="{tra 0='sign over'}" onClick='javascript: popup("{$UI_BROWSER}?popup[]=signover_1", "name", "400", "150");'/>
|
<input type="button" class="button" value="{##sign over##" onClick='javascript: popup("{$UI_BROWSER}?popup[]=signover_1", "name", "400", "150");'/>
|
||||||
*}
|
*}
|
||||||
{else}
|
{else}
|
||||||
<input type="button" class="button" value="{tra 0=login}" onClick='javascript: popup("{$UI_BROWSER}?popup[]=login", "name", "400", "150");'/>
|
<input type="button" class="button" value="##login##" onClick='javascript: popup("{$UI_BROWSER}?popup[]=login", "name", "400", "150");'/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -128,6 +128,7 @@ class uiBase
|
||||||
$this->BROWSE =& new uiBrowse($this);
|
$this->BROWSE =& new uiBrowse($this);
|
||||||
$this->PLAYLIST =& new uiPlaylist($this);
|
$this->PLAYLIST =& new uiPlaylist($this);
|
||||||
$this->SCHEDULER =& new uiScheduler($this);
|
$this->SCHEDULER =& new uiScheduler($this);
|
||||||
|
$this->SUBJECTS =& new uiSubjects($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,7 +150,7 @@ class uiBase
|
||||||
|
|
||||||
if ($miss && $this->gb->getSessLogin($this->sessid)) {
|
if ($miss && $this->gb->getSessLogin($this->sessid)) {
|
||||||
if (UI_WARNING) $this->_retMsg('Note: Station Preferences not setup proberly.');
|
if (UI_WARNING) $this->_retMsg('Note: Station Preferences not setup proberly.');
|
||||||
$this->redirUrl = UI_BROWSER.'?popup[]=_2changeStationPrefs&popup[]=_close';
|
$this->redirUrl = UI_BROWSER.'?popup[]=_2changeStationPrefs&popup[]=_close'; ## popup because check is taken in login-popup
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,98 +216,6 @@ class uiBrowser extends uiBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getSubjects
|
|
||||||
*
|
|
||||||
* get all GreenBox subjects (users/groups)
|
|
||||||
*
|
|
||||||
* @return array subj=>unique id of subject, loggedAs=>corresponding login name
|
|
||||||
*/
|
|
||||||
function getSubjects()
|
|
||||||
{
|
|
||||||
return array('subj' => $this->gb->getSubjectsWCnt(),
|
|
||||||
'loggedAs' => $this->login);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* addSubjectForm
|
|
||||||
*
|
|
||||||
* create a form to add GreenBox subjects (users/groups)
|
|
||||||
*
|
|
||||||
* @return string (html)
|
|
||||||
*/
|
|
||||||
function getAddSubjectForm($mask)
|
|
||||||
{
|
|
||||||
$form = new HTML_QuickForm('addSubject', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
|
||||||
$this->_parseArr2Form($form, $mask);
|
|
||||||
return $form->toHTML();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* chgPasswd
|
|
||||||
*
|
|
||||||
* create a form to change user-passwords in GreenBox
|
|
||||||
*
|
|
||||||
* @return string (html)
|
|
||||||
*/
|
|
||||||
function chgPasswd($uid, &$mask)
|
|
||||||
{
|
|
||||||
$form = new HTML_QuickForm('chgPasswd', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
|
||||||
$form->setConstants(array('uid' => $uid));
|
|
||||||
$this->_parseArr2Form($form, $mask);
|
|
||||||
return $form->toHTML();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getGroups
|
|
||||||
*
|
|
||||||
* get a list of groups where user is member of
|
|
||||||
*
|
|
||||||
* @parm $id int local user ID
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function groupMembers($id)
|
|
||||||
{
|
|
||||||
return array(
|
|
||||||
'rows' => $this->gb->listGroup($id),
|
|
||||||
'id' => $id,
|
|
||||||
'loggedAs' => $this->login,
|
|
||||||
'gname' => $this->gb->getSubjName($id),
|
|
||||||
'subj' => $this->gb->getSubjects()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getSubj2GroupForm
|
|
||||||
*
|
|
||||||
* creates a form to assign groups to a user
|
|
||||||
*
|
|
||||||
* @param $id int local user ID
|
|
||||||
*
|
|
||||||
* @return string (html)
|
|
||||||
*/
|
|
||||||
function addGroupMember($id)
|
|
||||||
{
|
|
||||||
$g = $this->groupMembers($id);
|
|
||||||
foreach($g['subj'] as $s) {
|
|
||||||
$this->logins[($s['login'])]=$s['login'];
|
|
||||||
}
|
|
||||||
$form = new HTML_QuickForm('addGroupMember', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
|
||||||
$form->setConstants(array('act'=>'addGroupMember',
|
|
||||||
'reid'=>$g['id'],
|
|
||||||
'gname'=>$g['gname']));
|
|
||||||
$form->addElement('hidden', 'act');
|
|
||||||
$form->addElement('hidden', 'reid');
|
|
||||||
$form->addElement('hidden', 'gname');
|
|
||||||
$s =& $form->createElement('select', 'login', 'Add Member: ');
|
|
||||||
$s->loadArray($this->logins, NULL);
|
|
||||||
$form->addElement($s);
|
|
||||||
$form->addElement('submit', NULL, tra('Do'));
|
|
||||||
return $form->toHTML();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getPermissions
|
* getPermissions
|
||||||
*
|
*
|
||||||
|
|
|
@ -34,12 +34,14 @@ $Smarty->assign('START', array(
|
||||||
'fid' => &$uiBrowser->fid,
|
'fid' => &$uiBrowser->fid,
|
||||||
'sessid' => &$uiBrowser->sessid)
|
'sessid' => &$uiBrowser->sessid)
|
||||||
);
|
);
|
||||||
$Smarty->assign('USER', array('sessid' => &$uiBrowser->sessid,
|
$Smarty->assign('USER', array(
|
||||||
|
'sessid' => &$uiBrowser->sessid,
|
||||||
'userid' => &$uiBrowser->userid,
|
'userid' => &$uiBrowser->userid,
|
||||||
'login' => &$uiBrowser->login)
|
'login' => &$uiBrowser->login)
|
||||||
);
|
);
|
||||||
$uiBrowser->loadStationPrefs($ui_fmask['stationPrefs']);
|
$uiBrowser->loadStationPrefs($ui_fmask['stationPrefs']);
|
||||||
$Smarty->assign('STATIONPREFS', $uiBrowser->STATIONPREFS);
|
$Smarty->assign('STATIONPREFS', $uiBrowser->STATIONPREFS);
|
||||||
|
$Smarty->assign_by_ref('_REQUEST', &$_REQUEST);
|
||||||
|
|
||||||
## retransfer incomplete formdata from SESSION to POST-data #########
|
## retransfer incomplete formdata from SESSION to POST-data #########
|
||||||
if (is_array($_SESSION['retransferFormData'])){
|
if (is_array($_SESSION['retransferFormData'])){
|
||||||
|
|
|
@ -85,6 +85,7 @@ require_once dirname(__FILE__).'/../../storageServer/var/GreenBox.php';
|
||||||
require_once dirname(__FILE__).'/formmask/generic.inc.php';
|
require_once dirname(__FILE__).'/formmask/generic.inc.php';
|
||||||
require_once dirname(__FILE__).'/ui_calendar.class.php';
|
require_once dirname(__FILE__).'/ui_calendar.class.php';
|
||||||
require_once dirname(__FILE__).'/ui_scheduler.class.php';
|
require_once dirname(__FILE__).'/ui_scheduler.class.php';
|
||||||
|
require_once dirname(__FILE__).'/ui_subjects.class.php';
|
||||||
|
|
||||||
## well known classes
|
## well known classes
|
||||||
require_once 'DB.php';
|
require_once 'DB.php';
|
||||||
|
|
|
@ -437,86 +437,6 @@ class uiHandler extends uiBase {
|
||||||
print_r($r);
|
print_r($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- subjs ----
|
|
||||||
/**
|
|
||||||
* addSubj
|
|
||||||
*
|
|
||||||
* Create new user or group (empty pass => create group)
|
|
||||||
*
|
|
||||||
* @param formdata array('login', 'pass')
|
|
||||||
*/
|
|
||||||
function addSubj(&$formdata, &$mask)
|
|
||||||
{
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act='.$formdata['act'];
|
|
||||||
|
|
||||||
## first validate the form data
|
|
||||||
if ($this->_validateForm($formdata, $mask)) {
|
|
||||||
if($this->gb->checkPerm($this->userid, 'subjects')){
|
|
||||||
$res = $this->gb->addSubj($formdata['login'], ($formdata['pass']=='' ? NULL : $formdata['pass']));
|
|
||||||
if (UI_VERBOSE) $this->_retMsg('Subject $1 added.', $formdata['login']);
|
|
||||||
} else {
|
|
||||||
$this->_retMsg('Access denied.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removeSubj
|
|
||||||
*
|
|
||||||
* Remove existing user or group
|
|
||||||
*
|
|
||||||
* @param login string, login name of removed user
|
|
||||||
*/
|
|
||||||
function removeSubj($login)
|
|
||||||
{
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=subjects';
|
|
||||||
|
|
||||||
if($this->gb->checkPerm($this->userid, 'subjects')){
|
|
||||||
$res = $this->gb->removeSubj($login);
|
|
||||||
}else{
|
|
||||||
$this->_retMsg('Access denied.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* chgPasswd
|
|
||||||
*
|
|
||||||
* Change password for specified user
|
|
||||||
*
|
|
||||||
* @param uid int, local user id
|
|
||||||
* @param oldpass string, old user password
|
|
||||||
* @param pass string, new password
|
|
||||||
* @param pass2 string, retype of new password
|
|
||||||
*/
|
|
||||||
function chgPasswd($uid, $oldpass, $pass, $pass2)
|
|
||||||
{
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=chgPasswd&uid='.$uid;
|
|
||||||
$ulogin = $this->gb->getSubjName($uid);
|
|
||||||
|
|
||||||
if($this->userid != $uid &&
|
|
||||||
! $this->gb->checkPerm($this->userid, 'subjects')){
|
|
||||||
$this->_retMsg('Access denied.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(FALSE === $this->gb->authenticate($ulogin, $oldpass)){
|
|
||||||
$this->_retMsg('Old password was incorrect.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if($pass !== $pass2){
|
|
||||||
$this->_retMsg("Passwords did not match.").
|
|
||||||
"($pass/$pass2)";
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=subjects';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$this->_retMsg('Password changed.');
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=subjects';
|
|
||||||
$this->gb->passwd($ulogin, $oldpass, $pass);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- perms ---
|
// --- perms ---
|
||||||
/**
|
/**
|
||||||
* addPerm
|
* addPerm
|
||||||
|
@ -561,51 +481,6 @@ class uiHandler extends uiBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* addSubj2Group
|
|
||||||
*
|
|
||||||
* Add {login} and direct/indirect members to {gname} and to groups,
|
|
||||||
* where {gname} is [in]direct member
|
|
||||||
*
|
|
||||||
* @param login string
|
|
||||||
* @param gname string
|
|
||||||
* @param reid string, local id of managed group, just needed for redirect
|
|
||||||
*/
|
|
||||||
function addSubj2Group(&$formdata)
|
|
||||||
{
|
|
||||||
if($this->gb->checkPerm($this->userid, 'subjects')){
|
|
||||||
$res = $this->gb->addSubj2Gr($formdata['login'], $formdata['gname']);
|
|
||||||
}else{
|
|
||||||
$this->_retMsg('Access denied.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
|
||||||
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=groupMembers&id='.$formdata['reid'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removeGroupMember
|
|
||||||
*
|
|
||||||
* Remove subject from group
|
|
||||||
*
|
|
||||||
* @param login string
|
|
||||||
* @param gname string
|
|
||||||
* @param reid string, local id of managed group, just needed for redirect
|
|
||||||
*/
|
|
||||||
function removeGroupMember(&$formdata)
|
|
||||||
{
|
|
||||||
if ($this->gb->checkPerm($this->userid, 'subjects')){
|
|
||||||
$res = $this->gb->removeSubjFromGr($formdata['login'], $formdata['gname']);
|
|
||||||
} else {
|
|
||||||
$this->_retMsg('Access denied.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=groupMembers&id='.$formdata['reid'];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function _validateForm(&$formdata, &$mask)
|
function _validateForm(&$formdata, &$mask)
|
||||||
{
|
{
|
||||||
$form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
$form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
|
@ -656,11 +531,13 @@ class uiHandler extends uiBase {
|
||||||
}
|
}
|
||||||
foreach($mask as $key=>$val) {
|
foreach($mask as $key=>$val) {
|
||||||
if ($val['isPref']) {
|
if ($val['isPref']) {
|
||||||
if (strlen($formdata[$val['element']]))
|
if (strlen($formdata[$val['element']])) {
|
||||||
$this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']]);
|
if (PEAR::isError($this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']])))
|
||||||
else
|
$this->_retMsg('Error saving Settings');
|
||||||
|
} else {
|
||||||
$this->gb->delGroupPref($this->sessid, 'StationPrefs', $val['element']);
|
$this->gb->delGroupPref($this->sessid, 'StationPrefs', $val['element']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
|
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
|
||||||
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
|
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
|
||||||
$this->_retMsg('Error uploading Logo');
|
$this->_retMsg('Error uploading Logo');
|
||||||
|
|
260
livesupport/modules/htmlUI/var/ui_subjects.class.php
Executable file
260
livesupport/modules/htmlUI/var/ui_subjects.class.php
Executable file
|
@ -0,0 +1,260 @@
|
||||||
|
<?php
|
||||||
|
class uiSubjects
|
||||||
|
{
|
||||||
|
function uiSubjects(&$uiBase)
|
||||||
|
{
|
||||||
|
$this->Base =& $uiBase;
|
||||||
|
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||||
|
$this->redirUrl = UI_BROWSER.'?act=SUBJECTS';
|
||||||
|
}
|
||||||
|
|
||||||
|
function setReload()
|
||||||
|
{
|
||||||
|
$this->Base->redirUrl = $this->reloadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setRedir()
|
||||||
|
{
|
||||||
|
$this->Base->redirUrl = $this->redirUrl;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* getAddSubjectForm
|
||||||
|
*
|
||||||
|
* create a form to add GreenBox subjects (users/groups)
|
||||||
|
*
|
||||||
|
* @return string (html)
|
||||||
|
*/
|
||||||
|
function getAddSubjForm($type)
|
||||||
|
{
|
||||||
|
include dirname(__FILE__). '/formmask/subjects.php';
|
||||||
|
|
||||||
|
$form = new HTML_QuickForm('addSubject', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
|
$this->Base->_parseArr2Form($form, $mask[$type]);
|
||||||
|
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||||
|
$form->accept($renderer);
|
||||||
|
return $renderer->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* addSubj
|
||||||
|
*
|
||||||
|
* Create new user or group (empty pass => create group)
|
||||||
|
*
|
||||||
|
* @param formdata array('login', 'pass')
|
||||||
|
*/
|
||||||
|
function addSubj(&$formdata)
|
||||||
|
{
|
||||||
|
include dirname(__FILE__). '/formmask/subjects.php';
|
||||||
|
$this->setRedir();
|
||||||
|
|
||||||
|
if ($this->Base->_validateForm($formdata, $mask[$formdata['passwd'] ? 'addUser' : 'addGroup']) !== TRUE) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects') !== TRUE) {
|
||||||
|
$this->Base->_retMsg('Access denied.');
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if ($this->Base->gb->getSubjId($formdata['login'])) {
|
||||||
|
$this->Base->_retMsg('User or group "$1" already exists.', $formdata['login']);
|
||||||
|
$this->Base->redirUrl = $_SERVER['HTTP_REFERER'];
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PEAR::isError($res = $this->Base->gb->addSubj($formdata['login'], ($formdata['passwd']==='' ? NULL : $formdata['passwd'])))) {
|
||||||
|
$this->Base->_retMsg($res->getMessage());
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (UI_VERBOSE) $this->Base->_retMsg('Subject $1 added.', $formdata['login']);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* removeSubj
|
||||||
|
*
|
||||||
|
* Remove existing user or group
|
||||||
|
*
|
||||||
|
* @param login string, login name of removed user
|
||||||
|
*/
|
||||||
|
function removeSubj($request)
|
||||||
|
{
|
||||||
|
$this->setReload();
|
||||||
|
|
||||||
|
if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects') !== TRUE) {
|
||||||
|
$this->Base->_retMsg('Access denied.');
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (PEAR::isError($res = $this->Base->gb->removeSubj($request['login']))) {
|
||||||
|
$this->Base->_retMsg($res->getMessage());
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getChgPasswdForm
|
||||||
|
*
|
||||||
|
* create a form to change user-passwords in GreenBox
|
||||||
|
*
|
||||||
|
* @return string (html)
|
||||||
|
*/
|
||||||
|
function getChgPasswdForm($login, $su=FALSE)
|
||||||
|
{
|
||||||
|
include dirname(__FILE__). '/formmask/subjects.php';
|
||||||
|
|
||||||
|
$form = new HTML_QuickForm('chgPasswd', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
|
if ($su === TRUE) {
|
||||||
|
unset ($mask['chgPasswd']['oldpasswd']);
|
||||||
|
}
|
||||||
|
$this->Base->_parseArr2Form($form, $mask['chgPasswd']);
|
||||||
|
$form->setConstants(array('login' => $login));
|
||||||
|
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||||
|
$form->accept($renderer);
|
||||||
|
return $renderer->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* chgPasswd
|
||||||
|
*
|
||||||
|
* Change password for specified user
|
||||||
|
*
|
||||||
|
* @param uid int, local user id
|
||||||
|
* @param oldpass string, old user password
|
||||||
|
* @param pass string, new password
|
||||||
|
* @param pass2 string, retype of new password
|
||||||
|
*/
|
||||||
|
function chgPasswd($request)
|
||||||
|
{
|
||||||
|
$this->setRedir();
|
||||||
|
|
||||||
|
if ($this->Base->userid != $uid &&
|
||||||
|
! $this->Base->gb->checkPerm($this->Base->userid, 'subjects')){
|
||||||
|
$this->Base->_retMsg('Access denied.');
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (FALSE === $this->Base->gb->authenticate($request['login'], $request['oldpasswd'])) {
|
||||||
|
$this->Base->_retMsg('Old password was incorrect.');
|
||||||
|
$this->Base->redirUrl = $_SERVER['HTTP_REFERER'];
|
||||||
|
return FASLE;
|
||||||
|
}
|
||||||
|
if ($request['passwd'] !== $request['passwd2']) {
|
||||||
|
$this->Base->_retMsg("Passwords did not match.");
|
||||||
|
$this->Base->redirUrl = $_SERVER['HTTP_REFERER'];
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (UI_VERBOSE)
|
||||||
|
$this->Base->_retMsg('Password changed.');
|
||||||
|
if (PEAR::isError($ret = $this->Base->gb->passwd($request['login'], $request['oldpass'], $request['pass']))) {
|
||||||
|
$this->Base->_retMsg($ret->getMessage());
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getSubjects
|
||||||
|
*
|
||||||
|
* get all GreenBox subjects (users/groups)
|
||||||
|
*
|
||||||
|
* @return array subj=>unique id of subject, loggedAs=>corresponding login name
|
||||||
|
*/
|
||||||
|
function getSubjectsWCnt()
|
||||||
|
{
|
||||||
|
return $this->Base->gb->getSubjectsWCnt();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getGroupMember
|
||||||
|
*
|
||||||
|
* get a list of groups where user is member of
|
||||||
|
*
|
||||||
|
* @parm $id int local user ID
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getGroupMember($id)
|
||||||
|
{
|
||||||
|
return $this->Base->gb->listGroup($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getNonGroupMember
|
||||||
|
*
|
||||||
|
* get a list of groups where user is member of
|
||||||
|
*
|
||||||
|
* @parm $id int local user ID
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getNonGroupMember($id)
|
||||||
|
{
|
||||||
|
foreach($this->Base->gb->listGroup($id) as $val1)
|
||||||
|
$members[$val1['id']] = TRUE;
|
||||||
|
|
||||||
|
$all = $this->Base->gb->getSubjectsWCnt();
|
||||||
|
foreach($all as $key2=>$val2)
|
||||||
|
if($members[$val2['id']])
|
||||||
|
unset($all[$key2]);
|
||||||
|
|
||||||
|
return $all;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* addSubj2Group
|
||||||
|
*
|
||||||
|
* Add {login} and direct/indirect members to {gname} and to groups,
|
||||||
|
* where {gname} is [in]direct member
|
||||||
|
*
|
||||||
|
* @param login string
|
||||||
|
* @param gname string
|
||||||
|
* @param reid string, local id of managed group, just needed for redirect
|
||||||
|
*/
|
||||||
|
function addSubj2Group(&$request)
|
||||||
|
{
|
||||||
|
$this->Base->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||||
|
|
||||||
|
if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects') !== TRUE){
|
||||||
|
$this->Base->_retMsg('Access denied.');
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (PEAR::isError($res = $this->Base->gb->addSubj2Gr($request['login'], $request['gname']))) {
|
||||||
|
$this->Base->_retMsg($res->getMessage());
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* removeGroupMember
|
||||||
|
*
|
||||||
|
* Remove subject from group
|
||||||
|
*
|
||||||
|
* @param login string
|
||||||
|
* @param gname string
|
||||||
|
* @param reid string, local id of managed group, just needed for redirect
|
||||||
|
*/
|
||||||
|
function removeSubjFromGr(&$request)
|
||||||
|
{
|
||||||
|
$this->setReload();
|
||||||
|
if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects') !== TRUE){
|
||||||
|
$this->Base->_retMsg('Access denied.');
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (PEAR::isError($res = $this->Base->gb->removeSubjFromGr($request['login'], $request['gname']))) {
|
||||||
|
$this->Base->_retMsg($res->getMessage());
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
Loading…
Add table
Add a link
Reference in a new issue