fix phpcs

This commit is contained in:
Frédéric FRANCE 2020-12-20 10:28:06 +01:00
parent 8d21eab6ab
commit f9ea75df3d
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
4 changed files with 219 additions and 130 deletions

View File

@ -15,6 +15,9 @@ function faaa()
return 'faaa';
}
/**
* Class Aaa
*/
class Aaa
{
const AAA='aaa';

View File

@ -12,6 +12,9 @@ function fbbb()
return 'fbbb';
}
/**
* Class Bbb
*/
class Bbb
{
const BBB='bbb';

View File

@ -161,7 +161,6 @@ if (!count($listofmethods)) {
}
if ($action == 'edit') {
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';

View File

@ -44,21 +44,45 @@ dolibarr_install_syslog("- fileconf: entering fileconf.php page");
// install.forced.php into directory htdocs/install (This is the case with some wizard
// installer like DoliWamp, DoliMamp or DoliBuntu).
// We first init "forced values" to nothing.
if (!isset($force_install_noedit)) $force_install_noedit = ''; // 1=To block vars specific to distrib, 2 to block all technical parameters
if (!isset($force_install_type)) $force_install_type = '';
if (!isset($force_install_dbserver)) $force_install_dbserver = '';
if (!isset($force_install_port)) $force_install_port = '';
if (!isset($force_install_database)) $force_install_database = '';
if (!isset($force_install_prefix)) $force_install_prefix = '';
if (!isset($force_install_createdatabase)) $force_install_createdatabase = '';
if (!isset($force_install_databaselogin)) $force_install_databaselogin = '';
if (!isset($force_install_databasepass)) $force_install_databasepass = '';
if (!isset($force_install_databaserootlogin)) $force_install_databaserootlogin = '';
if (!isset($force_install_databaserootpass)) $force_install_databaserootpass = '';
if (!isset($force_install_noedit)) {
$force_install_noedit = ''; // 1=To block vars specific to distrib, 2 to block all technical parameters
}
if (!isset($force_install_type)) {
$force_install_type = '';
}
if (!isset($force_install_dbserver)) {
$force_install_dbserver = '';
}
if (!isset($force_install_port)) {
$force_install_port = '';
}
if (!isset($force_install_database)) {
$force_install_database = '';
}
if (!isset($force_install_prefix)) {
$force_install_prefix = '';
}
if (!isset($force_install_createdatabase)) {
$force_install_createdatabase = '';
}
if (!isset($force_install_databaselogin)) {
$force_install_databaselogin = '';
}
if (!isset($force_install_databasepass)) {
$force_install_databasepass = '';
}
if (!isset($force_install_databaserootlogin)) {
$force_install_databaserootlogin = '';
}
if (!isset($force_install_databaserootpass)) {
$force_install_databaserootpass = '';
}
// Now we load forced values from install.forced.php file.
$useforcedwizard = false;
$forcedfile = "./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile = "/etc/dolibarr/install.forced.php"; // Must be after inc.php
if ($conffile == "/etc/dolibarr/conf.php") {
$forcedfile = "/etc/dolibarr/install.forced.php"; // Must be after inc.php
}
if (@file_exists($forcedfile)) {
$useforcedwizard = true;
include_once $forcedfile;
@ -75,8 +99,7 @@ session_start(); // To be able to keep info into session (used for not losing pa
pHeader($langs->trans("ConfigurationFile"), "step1", "set", "", (empty($force_dolibarr_js_JQUERY) ? '' : $force_dolibarr_js_JQUERY.'/'), 'main-inside-bis');
// Test if we can run a first install process
if (!is_writable($conffile))
{
if (!is_writable($conffile)) {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
dolibarr_install_syslog("fileconf: config file is not writable", LOG_WARNING);
dolibarr_install_syslog("- fileconf: end");
@ -84,29 +107,30 @@ if (!is_writable($conffile))
exit;
}
if (!empty($force_install_message))
{
if (!empty($force_install_message)) {
print '<div><br>'.$langs->trans($force_install_message).'</div>';
/*print '<script type="text/javascript">';
print ' jQuery(document).ready(function() {
print ' jQuery(document).ready(function() {
jQuery("#linktoshowtechnicalparam").click(function() {
jQuery(".hidewhenedit").hide();
jQuery(".hidewhennoedit").show();
});';
if ($force_install_noedit) print 'jQuery(".hidewhennoedit").hide();';
if ($force_install_noedit) print 'jQuery(".hidewhennoedit").hide();';
print '});';
print '</script>';
print '</script>';
print '<br><a href="#" id="linktoshowtechnicalparam" class="hidewhenedit">'.$langs->trans("ShowEditTechnicalParameters").'</a><br>';
*/
print '<br><a href="#" id="linktoshowtechnicalparam" class="hidewhenedit">'.$langs->trans("ShowEditTechnicalParameters").'</a><br>';
*/
}
?>
<div>
<table class="nobordernopadding<?php if ($force_install_noedit) print ' hidewhennoedit'; ?>">
<table class="nobordernopadding<?php if ($force_install_noedit) {
print ' hidewhennoedit';
} ?>">
<tr>
<td colspan="3" class="label">
@ -116,7 +140,7 @@ if (!empty($force_install_message))
<!-- Documents root $dolibarr_main_document_root -->
<tr>
<td class="label"><label for="main_dir"><b><?php print $langs->trans("WebPagesDirectory"); ?></b></label></td>
<td class="label"><label for="main_dir"><b><?php print $langs->trans("WebPagesDirectory"); ?></b></label></td>
<?php
if (empty($dolibarr_main_url_root)) {
$dolibarr_main_document_root = detect_dolibarr_main_document_root();
@ -124,10 +148,10 @@ if (empty($dolibarr_main_url_root)) {
?>
<td class="label">
<input type="text"
class="minwidth300"
id="main_dir"
name="main_dir"
value="<?php print $dolibarr_main_document_root ?>"
class="minwidth300"
id="main_dir"
name="main_dir"
value="<?php print $dolibarr_main_document_root ?>"
<?php
if (!empty($force_install_noedit)) {
print ' disabled';
@ -157,10 +181,10 @@ if (!empty($force_install_noedit)) {
?>
<td class="label">
<input type="text"
class="minwidth300"
id="main_data_dir"
name="main_data_dir"
value="<?php print $dolibarr_main_data_root ?>"
class="minwidth300"
id="main_data_dir"
name="main_data_dir"
value="<?php print $dolibarr_main_data_root ?>"
<?php if (!empty($force_install_noedit)) {
print ' disabled';
} ?>
@ -185,14 +209,14 @@ if (!empty($force_install_noedit)) {
}
?>
<tr>
<td class="label"><label for="main_url"><b><?php echo $langs->trans("URLRoot"); ?></b></label>
<td class="label"><label for="main_url"><b><?php echo $langs->trans("URLRoot"); ?></b></label>
</td>
<td class="label">
<input type="text"
class="minwidth300"
id="main_url"
name="main_url"
value="<?php print $dolibarr_main_url_root; ?> "
class="minwidth300"
id="main_url"
name="main_url"
value="<?php print $dolibarr_main_url_root; ?> "
<?php if (!empty($force_install_noedit)) {
print ' disabled';
}
@ -212,13 +236,17 @@ if (!empty($force_install_noedit)) {
if (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') { // Enabled if the installation process is "https://"
?>
<tr>
<td class="label"><label for="main_force_https"><?php echo $langs->trans("ForceHttps"); ?></label></td>
<td class="label">
<input type="checkbox"
id="main_force_https"
name="main_force_https"
<?php if (!empty($force_install_mainforcehttps)) { print ' checked'; } ?>
<?php if ($force_install_noedit == 2 && $force_install_mainforcehttps !== null) { print ' disabled'; } ?>
<td class="label"><label for="main_force_https"><?php echo $langs->trans("ForceHttps"); ?></label></td>
<td class="label">
<input type="checkbox"
id="main_force_https"
name="main_force_https"
<?php if (!empty($force_install_mainforcehttps)) {
print ' checked';
} ?>
<?php if ($force_install_noedit == 2 && $force_install_mainforcehttps !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("CheckToForceHttps"); ?>
@ -238,13 +266,15 @@ if (!empty($force_install_noedit)) {
</tr>
<tr>
<td class="label"><label for="db_name"><b><?php echo $langs->trans("DatabaseName"); ?></b></label></td>
<td class="label"><label for="db_name"><b><?php echo $langs->trans("DatabaseName"); ?></b></label></td>
<td class="label">
<input type="text"
id="db_name"
name="db_name"
value="<?php echo (!empty($dolibarr_main_db_name)) ? $dolibarr_main_db_name : ($force_install_database ? $force_install_database : 'dolibarr'); ?>"
<?php if ($force_install_noedit == 2 && $force_install_database !== null) { print ' disabled'; } ?>
id="db_name"
name="db_name"
value="<?php echo (!empty($dolibarr_main_db_name)) ? $dolibarr_main_db_name : ($force_install_database ? $force_install_database : 'dolibarr'); ?>"
<?php if ($force_install_noedit == 2 && $force_install_database !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("DatabaseName"); ?></td>
@ -252,8 +282,7 @@ if (!empty($force_install_noedit)) {
<?php
if (!isset($dolibarr_main_db_host))
{
if (!isset($dolibarr_main_db_host)) {
$dolibarr_main_db_host = "localhost";
}
?>
@ -273,55 +302,86 @@ if (!empty($force_install_noedit)) {
// Scan les drivers
$dir = DOL_DOCUMENT_ROOT.'/core/db';
$handle = opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle)) !== false)
{
if (is_readable($dir."/".$file) && preg_match('/^(.*)\.class\.php$/i', $file, $reg))
{
if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) {
if (is_readable($dir."/".$file) && preg_match('/^(.*)\.class\.php$/i', $file, $reg)) {
$type = $reg[1];
if ($type === 'DoliDB') continue; // Skip abstract class
if ($type === 'DoliDB') {
continue; // Skip abstract class
}
$class = 'DoliDB'.ucfirst($type);
include_once $dir."/".$file;
if ($type == 'sqlite') continue; // We hide sqlite because support can't be complete until sqlite does not manage foreign key creation after table creation (ALTER TABLE child ADD CONSTRAINT not supported)
if ($type == 'sqlite3') continue; // We hide sqlite3 because support can't be complete until sqlite does not manage foreign key creation after table creation (ALTER TABLE child ADD CONSTRAINT not supported)
if ($type == 'sqlite') {
continue; // We hide sqlite because support can't be complete until sqlite does not manage foreign key creation after table creation (ALTER TABLE child ADD CONSTRAINT not supported)
}
if ($type == 'sqlite3') {
continue; // We hide sqlite3 because support can't be complete until sqlite does not manage foreign key creation after table creation (ALTER TABLE child ADD CONSTRAINT not supported)
}
// Version min of database
$versionbasemin = explode('.', $class::VERSIONMIN);
$note = '('.$class::LABEL.' >= '.$class::VERSIONMIN.')';
// Switch to mysql if mysqli is not present
if ($defaultype == 'mysqli' && !function_exists('mysqli_connect')) $defaultype = 'mysql';
if ($defaultype == 'mysqli' && !function_exists('mysqli_connect')) {
$defaultype = 'mysql';
}
// Show line into list
if ($type == 'mysql') { $testfunction = 'mysql_connect'; $testclass = ''; }
if ($type == 'mysqli') { $testfunction = 'mysqli_connect'; $testclass = ''; }
if ($type == 'pgsql') { $testfunction = 'pg_connect'; $testclass = ''; }
if ($type == 'mssql') { $testfunction = 'mssql_connect'; $testclass = ''; }
if ($type == 'sqlite') { $testfunction = ''; $testclass = 'PDO'; }
if ($type == 'sqlite3') { $testfunction = ''; $testclass = 'SQLite3'; }
if ($type == 'mysql') {
$testfunction = 'mysql_connect'; $testclass = '';
}
if ($type == 'mysqli') {
$testfunction = 'mysqli_connect'; $testclass = '';
}
if ($type == 'pgsql') {
$testfunction = 'pg_connect'; $testclass = '';
}
if ($type == 'mssql') {
$testfunction = 'mssql_connect'; $testclass = '';
}
if ($type == 'sqlite') {
$testfunction = ''; $testclass = 'PDO';
}
if ($type == 'sqlite3') {
$testfunction = ''; $testclass = 'SQLite3';
}
$option .= '<option value="'.$type.'"'.($defaultype == $type ? ' selected' : '');
if ($testfunction && !function_exists($testfunction)) $option .= ' disabled';
if ($testclass && !class_exists($testclass)) $option .= ' disabled';
if ($testfunction && !function_exists($testfunction)) {
$option .= ' disabled';
}
if ($testclass && !class_exists($testclass)) {
$option .= ' disabled';
}
$option .= '>';
$option .= $type.'&nbsp; &nbsp;';
if ($note) $option .= ' '.$note;
if ($note) {
$option .= ' '.$note;
}
// Deprecated and experimental
if ($type == 'mysql') $option .= ' '.$langs->trans("Deprecated");
elseif ($type == 'mssql') $option .= ' '.$langs->trans("VersionExperimental");
elseif ($type == 'sqlite') $option .= ' '.$langs->trans("VersionExperimental");
elseif ($type == 'sqlite3') $option .= ' '.$langs->trans("VersionExperimental");
// No available
elseif (!function_exists($testfunction)) $option .= ' - '.$langs->trans("FunctionNotAvailableInThisPHP");
if ($type == 'mysql') {
$option .= ' '.$langs->trans("Deprecated");
} elseif ($type == 'mssql') {
$option .= ' '.$langs->trans("VersionExperimental");
} elseif ($type == 'sqlite') {
$option .= ' '.$langs->trans("VersionExperimental");
} elseif ($type == 'sqlite3') {
$option .= ' '.$langs->trans("VersionExperimental");
} elseif (!function_exists($testfunction)) {
// No available
$option .= ' - '.$langs->trans("FunctionNotAvailableInThisPHP");
}
$option .= '</option>';
}
}
}
?>
<select id="db_type"
name="db_type"
<?php if ($force_install_noedit == 2 && $force_install_type !== null) { print ' disabled'; } ?>
name="db_type"
<?php if ($force_install_noedit == 2 && $force_install_type !== null) {
print ' disabled';
} ?>
>
<?php print $option; ?>
</select>
@ -335,10 +395,12 @@ if (!empty($force_install_noedit)) {
<td class="label"><label for="db_host"><b><?php echo $langs->trans("DatabaseServer"); ?></b></label></td>
<td class="label">
<input type="text"
id="db_host"
name="db_host"
value="<?php print (!empty($force_install_dbserver) ? $force_install_dbserver : (!empty($dolibarr_main_db_host) ? $dolibarr_main_db_host : 'localhost')); ?>"
<?php if ($force_install_noedit == 2 && $force_install_dbserver !== null) { print ' disabled'; } ?>
id="db_host"
name="db_host"
value="<?php print (!empty($force_install_dbserver) ? $force_install_dbserver : (!empty($dolibarr_main_db_host) ? $dolibarr_main_db_host : 'localhost')); ?>"
<?php if ($force_install_noedit == 2 && $force_install_dbserver !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("ServerAddressDescription"); ?>
@ -347,13 +409,15 @@ if (!empty($force_install_noedit)) {
</tr>
<tr class="hidesqlite">
<td class="label"><label for="db_port"><?php echo $langs->trans("Port"); ?></label></td>
<td class="label"><label for="db_port"><?php echo $langs->trans("Port"); ?></label></td>
<td class="label">
<input type="text"
name="db_port"
id="db_port"
value="<?php print (!empty($force_install_port)) ? $force_install_port : $dolibarr_main_db_port; ?>"
<?php if ($force_install_noedit == 2 && $force_install_port !== null) { print ' disabled'; } ?>
name="db_port"
id="db_port"
value="<?php print (!empty($force_install_port)) ? $force_install_port : $dolibarr_main_db_port; ?>"
<?php if ($force_install_noedit == 2 && $force_install_port !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("ServerPortDescription"); ?>
@ -362,26 +426,32 @@ if (!empty($force_install_noedit)) {
</tr>
<tr class="hidesqlite">
<td class="label"><label for="db_prefix"><?php echo $langs->trans("DatabasePrefix"); ?></label></td>
<td class="label"><label for="db_prefix"><?php echo $langs->trans("DatabasePrefix"); ?></label></td>
<td class="label">
<input type="text"
id="db_prefix"
name="db_prefix"
value="<?php echo(!empty($force_install_prefix) ? $force_install_prefix : (!empty($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : 'llx_')); ?>"
<?php if ($force_install_noedit == 2 && $force_install_prefix !== null) { print ' disabled'; } ?>
id="db_prefix"
name="db_prefix"
value="<?php echo(!empty($force_install_prefix) ? $force_install_prefix : (!empty($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : 'llx_')); ?>"
<?php if ($force_install_noedit == 2 && $force_install_prefix !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("DatabasePrefixDescription"); ?></td>
</tr>
<tr class="hidesqlite">
<td class="label"><label for="db_create_database"><?php echo $langs->trans("CreateDatabase"); ?></label></td>
<td class="label"><label for="db_create_database"><?php echo $langs->trans("CreateDatabase"); ?></label></td>
<td class="label">
<input type="checkbox"
id="db_create_database"
name="db_create_database"
<?php if ($force_install_createdatabase) { print ' checked'; } ?>
<?php if ($force_install_noedit == 2 && $force_install_createdatabase !== null) { print ' disabled'; } ?>
id="db_create_database"
name="db_create_database"
<?php if ($force_install_createdatabase) {
print ' checked';
} ?>
<?php if ($force_install_noedit == 2 && $force_install_createdatabase !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("CheckToCreateDatabase"); ?>
@ -392,10 +462,12 @@ if (!empty($force_install_noedit)) {
<td class="label"><label for="db_user"><b><?php echo $langs->trans("Login"); ?></b></label></td>
<td class="label">
<input type="text"
id="db_user"
name="db_user"
value="<?php print (!empty($force_install_databaselogin)) ? $force_install_databaselogin : $dolibarr_main_db_user; ?>"
<?php if ($force_install_noedit == 2 && $force_install_databaselogin !== null) { print ' disabled'; } ?>
id="db_user"
name="db_user"
value="<?php print (!empty($force_install_databaselogin)) ? $force_install_databaselogin : $dolibarr_main_db_user; ?>"
<?php if ($force_install_noedit == 2 && $force_install_databaselogin !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("AdminLogin"); ?></td>
@ -405,17 +477,19 @@ if (!empty($force_install_noedit)) {
<td class="label"><label for="db_pass"><b><?php echo $langs->trans("Password"); ?></b></label></td>
<td class="label">
<input type="password"
id="db_pass" autocomplete="off"
name="db_pass"
value="<?php
// If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1.
$autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : str_pad('', strlen($force_install_databasepass), '*'));
if (!empty($dolibarr_main_prod)) {
$autofill = '';
}
print dol_escape_htmltag($autofill);
?>"
<?php if ($force_install_noedit == 2 && $force_install_databasepass !== null) { print ' disabled'; } ?>
id="db_pass" autocomplete="off"
name="db_pass"
value="<?php
// If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1.
$autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : str_pad('', strlen($force_install_databasepass), '*'));
if (!empty($dolibarr_main_prod)) {
$autofill = '';
}
print dol_escape_htmltag($autofill);
?>"
<?php if ($force_install_noedit == 2 && $force_install_databasepass !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("AdminPassword"); ?></td>
@ -425,10 +499,14 @@ if (!empty($force_install_noedit)) {
<td class="label"><label for="db_create_user"><?php echo $langs->trans("CreateUser"); ?></label></td>
<td class="label">
<input type="checkbox"
id="db_create_user"
name="db_create_user"
<?php if (!empty($force_install_createuser)) { print ' checked'; } ?>
<?php if ($force_install_noedit == 2 && $force_install_createuser !== null) { print ' disabled'; } ?>
id="db_create_user"
name="db_create_user"
<?php if (!empty($force_install_createuser)) {
print ' checked';
} ?>
<?php if ($force_install_noedit == 2 && $force_install_createuser !== null) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("CheckToCreateUser"); ?>
@ -451,11 +529,13 @@ if (!empty($force_install_noedit)) {
<td class="label"><label for="db_user_root"><b><?php echo $langs->trans("Login"); ?></b></label></td>
<td class="label">
<input type="text"
id="db_user_root"
name="db_user_root"
class="needroot"
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>"
<?php if ($force_install_noedit > 0 && !empty($force_install_databaserootlogin)) { print ' disabled'; } ?>
id="db_user_root"
name="db_user_root"
class="needroot"
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>"
<?php if ($force_install_noedit > 0 && !empty($force_install_databaserootlogin)) {
print ' disabled';
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("DatabaseRootLoginDescription"); ?>
@ -473,25 +553,29 @@ if (!empty($force_install_noedit)) {
<td class="label"><label for="db_pass_root"><b><?php echo $langs->trans("Password"); ?></b></label></td>
<td class="label">
<input type="password"
autocomplete="off"
id="db_pass_root"
name="db_pass_root"
class="needroot"
value="<?php
autocomplete="off"
id="db_pass_root"
name="db_pass_root"
class="needroot"
value="<?php
// If $force_install_databaserootpass is on, we don't want to set password here, we just show '***'. Real value will be extracted from the forced install file at step1.
$autofill = ((!empty($force_install_databaserootpass)) ? str_pad('', strlen($force_install_databaserootpass), '*') : @$db_pass_root);
if (!empty($dolibarr_main_prod)) {
$autofill = '';
}
// Do not autofill password if instance is a production instance
if (!empty($_SERVER["SERVER_NAME"]) && !in_array($_SERVER["SERVER_NAME"],
array('127.0.0.1', 'localhost', 'localhostgit'))
if (!empty($_SERVER["SERVER_NAME"]) && !in_array(
$_SERVER["SERVER_NAME"],
array('127.0.0.1', 'localhost', 'localhostgit')
)
) {
$autofill = '';
} // Do not autofill password for remote access
print dol_escape_htmltag($autofill);
?>"
<?php if ($force_install_noedit > 0 && !empty($force_install_databaserootpass)) { print ' disabled'; /* May be removed by javascript*/ } ?>
<?php if ($force_install_noedit > 0 && !empty($force_install_databaserootpass)) {
print ' disabled'; /* May be removed by javascript*/
} ?>
>
</td>
<td class="comment"><?php echo $langs->trans("KeepEmptyIfNoPassword"); ?>
@ -535,7 +619,7 @@ jQuery(document).ready(function() {
jQuery(".hideroot").show();
<?php
if ($force_install_noedit == 0) { ?>
jQuery(".needroot").removeAttr('disabled');
jQuery(".needroot").removeAttr('disabled');
<?php } ?>
}
else