Skip to content

Commit

Permalink
Fix issue 04022: Some notices at the admin panel are not centered
Browse files Browse the repository at this point in the history
Dev updated layout for several admin functions 



git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8205 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Tony Partner committed Dec 28, 2009
1 parent aab024d commit 5544a62
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 84 deletions.
70 changes: 40 additions & 30 deletions admin/html.php
Expand Up @@ -1569,49 +1569,55 @@
if($action == "addsurveysecurity")
{
$addsummary = "<div class='header'>".$clang->gT("Add User")."</div>\n";
$addsummary .= "<div class=\"messagebox\">\n";

$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID']." AND owner_id != ".$postuserid;
$result = db_execute_assoc($query); //Checked
if( ($result->RecordCount() > 0 && in_array($postuserid,getuserlist('onlyuidarray'))) ||
$_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
{

if($postuserid > 0){

$isrquery = "INSERT INTO {$dbprefix}surveys_rights VALUES($surveyid,". $postuserid.",0,0,0,0,0,0)";
$isrresult = $connect->Execute($isrquery); //Checked

if($isrresult)
{
$addsummary .= "<p>".$clang->gT("User added.")."<br />\n";
$addsummary .= "<div class=\"successheader\">".$clang->gT("User added.")."</div>\n";
$addsummary .= "<br /><form method='post' action='$scriptname?sid={$surveyid}'>"
."<p><input type='submit' value='".$clang->gT("Set Survey Rights")."' />"
."<input type='submit' value='".$clang->gT("Set Survey Rights")."' />"
."<input type='hidden' name='action' value='setsurveysecurity' />"
."<input type='hidden' name='uid' value='{$postuserid}' />"
."</form>\n";
}
else
{
// Username already exists.
$addsummary .= "<p><strong>".$clang->gT("Failed to add user.")."</strong><br />\n" . " " . $clang->gT("Username already exists.")."<br />\n";
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add user.")."</div>\n"
. "<br />" . $clang->gT("Username already exists.")."<br />\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?sid={$surveyid}&amp;action=surveysecurity', '_top')\" value=\"".$clang->gT("Continue")."\"/>\n";
}
$addsummary .= "<p><a href='$scriptname?action=surveysecurity&amp;sid={$surveyid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
else
{
$addsummary .= "<p><strong>".$clang->gT("Failed to add User.")."</strong><br />\n" . " " . $clang->gT("No Username selected.")."<br />\n";
$addsummary .= "<br /><a href='$scriptname?action=surveysecurity&amp;sid={$surveyid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add User.")."</div>\n"
. "<br />" . $clang->gT("No Username selected.")."<br />\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?sid={$surveyid}&amp;action=surveysecurity', '_top')\" value=\"".$clang->gT("Continue")."\"/>\n";
}
}
else
{
include("access_denied.php");
}
$addsummary .= "</div>\n";
}


if($action == "addusergroupsurveysecurity")
{
$addsummary = "<br /><strong>".$clang->gT("Add User Group")."</strong><br />\n";
$addsummary = "<div class=\"header\">".$clang->gT("Add User Group")."</div>\n";
$addsummary .= "<div class=\"messagebox\">\n";

$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID'];
$result = db_execute_assoc($query); //Checked
Expand All @@ -1635,7 +1641,7 @@

if($isrresult)
{
$addsummary .= "<br />".$clang->gT("User Group added.")."<br />\n";
$addsummary .= "<div class=\"successheader\">".$clang->gT("User Group added.")."</div>\n";
$_SESSION['uids'] = $uid_arr;
$addsummary .= "<br /><form method='post' action='$scriptname?sid={$surveyid}'>"
."<input type='submit' value='".$clang->gT("Set Survey Rights")."' />"
Expand All @@ -1647,48 +1653,52 @@
else
{
// no user to add
$addsummary .= "<br /><strong>".$clang->gT("Failed to add User Group.")."</strong><br />\n";
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add User Group.")."</div>\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&amp;sid={$surveyid}', '_top')\" value=\"".$clang->gT("Continue")."\"/>\n";
}
$addsummary .= "<br /><a href='$scriptname?action=surveysecurity&amp;sid={$surveyid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
else
{
$addsummary .= "<br /><strong>".$clang->gT("Failed to add User.")."</strong><br />\n" . " " . $clang->gT("No Username selected.")."<br />\n";
$addsummary .= "<br /><a href='$scriptname?action=surveysecurity&amp;sid={$surveyid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Failed to add User.")."</div>\n"
. "<br />" . $clang->gT("No Username selected.")."<br />\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=surveysecurity&amp;sid={$surveyid}', '_top')\" value=\"".$clang->gT("Continue")."\"/>\n";
}
}
else
{
include("access_denied.php");
}
$addsummary .= "</div>\n";
}

if($action == "delsurveysecurity"){
{
$addsummary = "<br /><strong>".$clang->gT("Deleting User")."</strong><br />\n";
if($action == "delsurveysecurity")
{
$addsummary = "<div class=\"header\">".$clang->gT("Deleting User")."</div>\n";
$addsummary .= "<div class=\"messagebox\">\n";

$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID']." AND owner_id != ".$postuserid;
$result = db_execute_assoc($query); //Checked
if($result->RecordCount() > 0 || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
$query = "SELECT sid, owner_id FROM ".db_table_name('surveys')." WHERE sid = {$surveyid} AND owner_id = ".$_SESSION['loginID']." AND owner_id != ".$postuserid;
$result = db_execute_assoc($query); //Checked
if($result->RecordCount() > 0 || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
{
if (isset($postuserid))
{
if (isset($postuserid))
{
$dquery="DELETE FROM {$dbprefix}surveys_rights WHERE uid={$postuserid} AND sid={$surveyid}"; // added by Dennis
$dresult=$connect->Execute($dquery); //Checked
$dquery="DELETE FROM {$dbprefix}surveys_rights WHERE uid={$postuserid} AND sid={$surveyid}"; // added by Dennis
$dresult=$connect->Execute($dquery); //Checked

$addsummary .= "<br />".$clang->gT("Username").": ".sanitize_xss_string($_POST['user'])."<br />\n";
}
else
{
$addsummary .= "<br />".$clang->gT("Could not delete user. User was not supplied.")."<br />\n";
}
$addsummary .= "<br />".$clang->gT("Username").": ".sanitize_xss_string($_POST['user'])."<br /><br />\n";
$addsummary .= "<div class=\"successheader\">".$clang->gT("Success!")."</div>\n";
}
else
{
include("access_denied.php");
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Could not delete user. User was not supplied.")."</div>\n";
}
$addsummary .= "<br /><br /><a href='$scriptname?sid={$surveyid}&amp;action=surveysecurity'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?sid={$surveyid}&amp;action=surveysecurity', '_top')\" value=\"".$clang->gT("Continue")."\"/>\n";
}
else
{
include("access_denied.php");
}
$addsummary .= "</div>\n";
}

if($action == "setsurveysecurity")
Expand Down
16 changes: 10 additions & 6 deletions admin/usercontrol.php
Expand Up @@ -397,12 +397,13 @@
$addsummary .= "<div class='messagebox'><div class='warningheader'>".$clang->gT("Failed to add user")."</div><br />\n" . " " . $clang->gT("The user name already exists.")."<br />\n";
}
}
$addsummary .= "<p><a href='$scriptname?action=editusers'>".$clang->gT("Continue")."</a></div><br />&nbsp;\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=editusers', '_top')\" value=\"".$clang->gT("Continue")."\"/></div>\n";
}

elseif ($action == "deluser" && ($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_DELETE_USER'] ))
{
$addsummary = "<br /><strong>".$clang->gT("Deleting User")."</strong><br />\n";
$addsummary = "<div class=\"header\">".$clang->gT("Deleting User")."</div>\n";
$addsummary .= "<div class=\"messagebox\">\n";

// CAN'T DELETE ORIGINAL SUPERADMIN
// Initial SuperAdmin has parent_id == 0
Expand All @@ -412,7 +413,7 @@

if($row['uid'] == $postuserid) // it's the original superadmin !!!
{
$addsummary .= "<br />".$clang->gT("Initial Superadmin cannot be deleted!")."<br />\n";
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Initial Superadmin cannot be deleted!")."</div>\n";
}
else
{
Expand Down Expand Up @@ -451,7 +452,9 @@

if($postuserid == $_SESSION['loginID']) killSession(); // user deleted himself

$addsummary .= "<br />".$clang->gT("Username").": {$postuser}<br />\n";
$addsummary .= "<br />".$clang->gT("Username").": {$postuser}<br /><br />\n";
$addsummary .= "<div class=\"successheader\">".$clang->gT("Success!")."</div>\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=editusers', '_top')\" value=\"".$clang->gT("Continue")."\"/>\n";
}
else
{
Expand All @@ -460,10 +463,11 @@
}
else
{
$addsummary .= "<br />".$clang->gT("Could not delete user. User was not supplied.")."<br />\n";
$addsummary .= "<div class=\"warningheader\">".$clang->gT("Could not delete user. User was not supplied.")."</div>\n";
$addsummary .= "<br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=editusers', '_top')\" value=\"".$clang->gT("Continue")."\"/>\n";
}
}
$addsummary .= "<br /><br /><a href='$scriptname?action=editusers'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
$addsummary .= "</div>\n";
}

elseif ($action == "moduser")
Expand Down

0 comments on commit 5544a62

Please sign in to comment.