Skip to content

Commit

Permalink
Correctif #16
Browse files Browse the repository at this point in the history
  • Loading branch information
darknoon29 committed Nov 14, 2019
1 parent 5ae1aaa commit 94c8f4c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 25 deletions.
15 changes: 10 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@
</head>
<body>
<h1><?php echo($lang['MOD_XTENSE_ADMINTITLE']); ?></h1>
<script language="Javascript" type="text/javascript" src="mod/<?php echo $root; ?>/js/config.js"></script>

<script src="mod/<?php echo $root; ?>/js/config.js" type="text/javascript"></script>
<div id="wrapper">
<ul id="menu">
<li class="infos<?php if ($page == 'infos') echo ' active'; ?>">
Expand Down Expand Up @@ -205,15 +204,15 @@
<h2><?php echo($lang['MOD_XTENSE_CONNECTION_DETAILS']); ?></h2>
<p><label for="plugin"><strong><?php echo($lang['MOD_XTENSE_URL_PLUGIN']); ?></strong></label></p>
<p class="c">
<input type="text" class="infos" id="plugin" name="plugin" value="<?php echo $plugin_url; ?>"
<input type="text" class="infos" id="plugin_url" name="plugin" value=""
onclick="this.select();" readonly/>
</p> <p><label for="plugin"><strong><?php echo($lang['MOD_XTENSE_USER']); ?></strong></label></p>
<p class="c">
<input type="text" class="infos" id="plugin" name="name" value="<?php echo $user_data["user_name"]; ?>"
<input type="text" class="infos" id="plugin_user" name="name" value="<?php echo $user_data["user_name"]; ?>"
onclick="this.select();" readonly/>
</p> <p><label for="plugin"><strong><?php echo($lang['MOD_XTENSE_PASSWORD']); ?></strong></label></p>
<p class="c">
<input type="text" class="infos" id="plugin" name="password" value="<?php echo $my_user_token ?>"
<input type="text" class="infos" id="plugin_password" name="password" value="<?php echo $my_user_token ?>"
onclick="this.select();" readonly/>
</p>
<p><?php echo($lang['MOD_XTENSE_PSEUDO_PASSWORD']); ?></p><br>
Expand All @@ -225,6 +224,9 @@
<?php echo($lang['MOD_XTENSE_RENEW_TOKEN']); ?>
</p>
</div>
<script>
document.getElementById("plugin_url").value = get_xtense_url().toString();
</script>

<?php } elseif ($page == 'config') { ?>

Expand Down Expand Up @@ -482,5 +484,8 @@
target="_blank"><?php echo($lang['MOD_XTENSE_SUPPPORT']); ?></a>
</div>




</body>
</html>
56 changes: 37 additions & 19 deletions js/config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
var auth = ['system', 'ranking', 'empire', 'messages'];


function check_col (type, El) {
var status = El.checked;
for (i in groups_id) {
document.getElementById(type+'_'+groups_id[i]).checked = status;
}
El.checked = status;
function check_col(type, El) {
let status = El.checked;
for (let i in groups_id) {
document.getElementById(type + '_' + groups_id[i]).checked = status;
}
El.checked = status;
}

function check_row(id, El) {
var status = El.checked;
for (var i = 0; i < auth.length; i++) {
document.getElementById(auth[i]+'_'+id).checked = status;
}
El.checked = status;
let status = El.checked;
for (let i = 0; i < auth.length; i++) {
document.getElementById(auth[i] + '_' + id).checked = status;
}
El.checked = status;
}

function set_all (status) {
for (var i in groups_id) {
for (var a = 0; a < auth.length; a++) {
document.getElementById(auth[a]+'_'+groups_id[i]).checked = status;
}
}
function set_all(status) {
for (let i in groups_id) {
for (var a = 0; a < auth.length; a++) {
document.getElementById(auth[a] + '_' + groups_id[i]).checked = status;
}
}
}

function winOpen (El) {
try {window.opener.open(El.href); return false;} catch (e) {}
function get_xtense_url() {

const regex = /(.*)index\.php\?action=xtense/gm;
const str = window.location.href;
let m;

if ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
return m[1];
} else {
return "";
}
}

function winOpen(El) {
try {
window.opener.open(El.href);
return false;
} catch (e) {
}
}
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Xtense
2.7.5
2.7.6
Xtense,Xtense,xtense,xtense,index.php,1,1
3.3.5
2.7.22

0 comments on commit 94c8f4c

Please # to comment.