3
* Copyright (c) 2008 Zivios, LLC.
5
* This file is part of Zivios.
7
* Zivios is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
12
* Zivios is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with Zivios. If not, see <http://www.gnu.org/licenses/>.
20
* @package mod_openafs
21
* @copyright Copyright (c) 2008 Zivios, LLC. (http://www.zivios.org)
22
* @license http://www.zivios.org/legal/license
23
* @version $Id: volmountpoints.phtml 919 2008-08-25 11:45:23Z fkhan $
24
* @lastchangeddate $LastChangedDate: 2008-08-25 17:45:23 +0600 (Mon, 25 Aug 2008) $
29
<table border="0" width="100%" align="center">
30
<tr><td colspan="2"><b>Edit Mount Points</b></td></tr>
32
if (!empty($this->mountPoints)) {
34
foreach ($this->mountPoints as $mp => $mpt) {
35
if (strtolower($mpt) == "rw") {
43
$mpa = explode("/", $mp);
45
for ($x=3; $x < count($mpa); $x++) {
47
if ($x < count ($mpa)-1)
52
'<tr id="mpdiv'.$c.'">
53
<td width="350" NOWRAP>
54
<form id="femp'.$c.'">
55
<span id="editmp'.$c.'">' . $mp . '</span>
56
<span id="f_editmp'.$c.'" style="display: none;">
57
/afs/.' . $this->obj->getproperty('emsafscell') . '<input size="26" maxlength="64" type="text" name="nmp" value="' . $mpid . '" /><br />
59
<label for="MountPointType">Mount Point Type:</label>
60
<input type="radio" value="rw" name="vtype" '.$rw.'/> RW
61
<input type="radio" value="ro" name="vtype" '.$ro.'/> RO <br />
63
<label for="releaseBaseVol">Release base volume:</label>
64
<input type="checkbox" value="1" name="releasebasevol" CHECKED /> <br />
66
<input type="hidden" name="omp" value="' . $mp . '" />
67
<input type="hidden" name="ompcompare" value="'.$mpid.'" />
68
<input type="hidden" name="ovtype" value="'.strtolower($mpt).'" />
69
<input type="hidden" name="operate_dn" value="' . $this->obj->getdn() . '" />
70
<input type="hidden" name="voldn" value="' . $this->volEntry->getdn() . '" />
71
<input type="hidden" name="updateRequestFor" value="updatevolmountpoint" />
72
<input type="hidden" name="utype" value="update" />
77
<span id="emp'.$c.'"><a href="#" onclick="javascript:editMountPoint(\'emp'.$c.'\',\'editmp'.$c.'\',\'ump'.$c.'\',\'f_editmp'.$c.'\');">Edit</a></span>
78
<span id="ump'.$c.'" style="display: none;"><a href="#" onclick="javascript:updateMountPoint(\'femp'.$c.'\', \'emp'.$c.'\',\'editmp'.$c.'\',\'ump'.$c.'\',\'f_editmp'.$c.'\');">Save</a></span>
79
| <a href="#" onClick="javascript:deleteMountPoint(\''.$mp.'\', \'optrst\');">Delete</a>
85
echo '<tr><td>No Mountpoint Set</td></tr>';
92
<form method="post" action="#" onsubmit="return false;" id="addmountpoint">
94
<legend>Add Volume Mountpoint</legend>
95
<div class="notice">Path leading up to your mount point <b>must</b> exist</div>
96
<label for="MountPoint">/afs/.<?php echo $this->obj->getProperty("emsafscell");?>/ </label>
97
<input type="text" name="newmountpoint" value="" maxlength="64" size="32" /><br />
98
<label for="MountPointAccess">Mount Point Type:</label>
99
<input type="radio" value="rw" name="vtype" CHECKED /> RW
100
<input type="radio" value="ro" name="vtype" /> RO <br />
101
<label for="releaseBaseVol">Release base volume:</label>
102
<input type="checkbox" value="1" name="releasebasevol" CHECKED /> <br />
104
<input type="submit" name="anmp" value="Add Mountpoint"
105
onclick="javascript:callAfsFormAction('addmountpoint', '/openafs/server/addmountpoint', 'optrst');" />
106
<input type="hidden" name="operate_dn" value="<?php echo $this->obj->getdn(); ?>" />
107
<input type="hidden" name="voldn" value="<?php echo $this->volEntry->getdn(); ?>" />
108
<input type="hidden" name="addRequestFor" value="addvolmountpoint" />
109
<input type="hidden" name="utype" value="add" />
114
<script language="javascript">
116
* Show EditMountPoint Options
118
editMountPoint = function (emp, editmp, ump, f_editmp)
122
Element.hide(editmp);
124
Element.show(f_editmp);
127
updateMountPoint = function (fdiv, emp, editmp, ump, f_editmp)
130
var voltype = Form.getInputs(fdiv,'radio','vtype').find(function(radio) {
131
return radio.checked;
134
if (f.nmp.value.strip() == f.ompcompare.value && voltype == f.ovtype.value) {
136
* Cancel update and reset fields to orig values
139
Element.hide(f_editmp);
141
Element.show(editmp);
145
* Update the mountpoint.
147
callAfsFormAction(f, "/openafs/server/updateMountPoint", "optrst");
152
deleteMountPoint = function (mp, div)
154
var msg = "You are about to remove a mount point from the AFS filesystem.";
155
var url = "/openafs/server/deletemountpoint";
157
msg += " \n\nAre you certain you wish to continue?";
162
var data = {voldn: '<?php echo $this->volEntry->getdn(); ?>', mp: mp, operate_dn: '<?php echo $this->obj->getdn(); ?>'};
163
rpc = Object.toJSON(data);
165
var ma = new Ajax.Updater (
170
parameters: 'mr='+rpc,
172
onLoading: function(request) {
175
onComplete:function(request) {
b'\\ No newline at end of file'