-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permissions tweaks, role duplication, minor fixes.
- Loading branch information
Ross Parler
authored and
Ross Parler
committed
Jun 17, 2014
1 parent
84fed8e
commit 4bad03a
Showing
12 changed files
with
383 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
<?php | ||
/* | ||
Gibbon, Flexible & Open School System | ||
Copyright (C) 2010, Ross Parker | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
@session_start() ; | ||
|
||
//Module includes | ||
include "./modules/" . $_SESSION[$guid]["module"] . "/moduleFunctions.php" ; | ||
|
||
if (isActionAccessible($guid, $connection2, "/modules/User Admin/role_manage_duplicate.php")==FALSE) { | ||
//Acess denied | ||
print "<div class='error'>" ; | ||
print _("You do not have access to this action.") ; | ||
print "</div>" ; | ||
} | ||
else { | ||
//Get action with highest precendence | ||
print "<div class='trail'>" ; | ||
print "<div class='trailHead'><a href='" . $_SESSION[$guid]["absoluteURL"] . "'>" . _("Home") . "</a> > <a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_GET["q"]) . "/" . getModuleEntry($_GET["q"], $connection2, $guid) . "'>" . _(getModuleName($_GET["q"])) . "</a> > <a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/User Admin/role_manage.php'>" . _('Manage Roles') . "</a> > </div><div class='trailEnd'>" . _('Duplicate Role') . "</div>" ; | ||
print "</div>" ; | ||
|
||
//Proceed! | ||
if (isset($_GET["updateReturn"])) { $updateReturn=$_GET["updateReturn"] ; } else { $updateReturn="" ; } | ||
$updateReturnMessage="" ; | ||
$class="error" ; | ||
if (!($updateReturn=="")) { | ||
if ($updateReturn=="fail0") { | ||
$updateReturnMessage=_("Your request failed because you do not have access to this action.") ; | ||
} | ||
else if ($updateReturn=="fail1") { | ||
$updateReturnMessage=_("Your request failed because your inputs were invalid.") ; | ||
} | ||
else if ($updateReturn=="fail2") { | ||
$updateReturnMessage=_("Your request failed due to a database error.") ; | ||
} | ||
else if ($updateReturn=="fail3") { | ||
$updateReturnMessage=_("Your request failed because your inputs were invalid.") ; | ||
} | ||
else if ($updateReturn=="fail4") { | ||
$updateReturnMessage=_("Your request failed because your inputs were invalid.") ; | ||
} | ||
else if ($updateReturn=="fail5") { | ||
$updateReturnMessage=_("Your request failed due to an attachment error.") ; | ||
} | ||
else if ($updateReturn=="fail6") { | ||
$updateReturnMessage=_("Your request was successful, but some data was not properly saved.") ; | ||
} | ||
else if ($updateReturn=="success0") { | ||
$updateReturnMessage=_("Your request was completed successfully.") ; | ||
$class="success" ; | ||
} | ||
print "<div class='$class'>" ; | ||
print $updateReturnMessage; | ||
print "</div>" ; | ||
} | ||
|
||
//Check if courseschool year specified | ||
$gibbonRoleID=$_GET["gibbonRoleID"]; | ||
if ($gibbonRoleID=="") { | ||
print "<div class='error'>" ; | ||
print _("You have not specified one or more required parameters.") ; | ||
print "</div>" ; | ||
} | ||
else { | ||
try { | ||
$data=array("gibbonRoleID"=>$gibbonRoleID); | ||
$sql="SELECT * FROM gibbonRole WHERE gibbonRoleID=:gibbonRoleID" ; | ||
$result=$connection2->prepare($sql); | ||
$result->execute($data); | ||
} | ||
catch(PDOException $e) { | ||
print "<div class='error'>" . $e->getMessage() . "</div>" ; | ||
} | ||
|
||
if ($result->rowCount()!=1) { | ||
print "<div class='error'>" ; | ||
print _("The selected record does not exist, or you do not have access to it.") ; | ||
print "</div>" ; | ||
} | ||
else { | ||
$row=$result->fetch() ; | ||
|
||
|
||
?> | ||
<form method="post" action="<?php print $_SESSION[$guid]["absoluteURL"] . "/modules/" . $_SESSION[$guid]["module"] . "/role_manage_duplicateProcess.php?gibbonRoleID=$gibbonRoleID" ?>"> | ||
<table class='smallIntBorder' cellspacing='0' style="width: 100%"> | ||
<tr> | ||
<td> | ||
<b><?php print _('Role') ?> *</b><br/> | ||
<span style="font-size: 90%"><i><?php print _('This value cannot be changed.') ?></i></span> | ||
</td> | ||
<td class="right"> | ||
<?php print "<input readonly value='" . $row["name"] . "' type='text' style='width: 300px'>" ; ?> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<b><?php print _('Name') ?> *</b><br/> | ||
</td> | ||
<td class="right"> | ||
<input name="name" id="name" maxlength=20 value="" type="text" style="width: 300px"> | ||
<script type="text/javascript"> | ||
var name=new LiveValidation('name'); | ||
name.add(Validate.Presence); | ||
</script> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<b><?php print _('Name Short') ?> *</b><br/> | ||
</td> | ||
<td class="right"> | ||
<input name="nameShort" id="nameShort" maxlength=4 value="" type="text" style="width: 300px"> | ||
<script type="text/javascript"> | ||
var nameShort=new LiveValidation('nameShort'); | ||
nameShort.add(Validate.Presence); | ||
</script> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<span style="font-size: 90%"><i>* <?php print _("denotes a required field") ; ?></i></span> | ||
</td> | ||
<td class="right"> | ||
<input type="hidden" name="address" value="<?php print $_SESSION[$guid]["address"] ?>"> | ||
<input type="submit" value="<?php print _("Submit") ; ?>"> | ||
</td> | ||
</tr> | ||
</table> | ||
</form> | ||
<?php | ||
} | ||
} | ||
} | ||
?> |
Oops, something went wrong.