The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

New mysql index.html page voor x.theme

Discussion in 'User Experience' started by Miquel, Aug 11, 2005.

  1. Miquel

    Miquel Member

    Joined:
    Jan 19, 2004
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    The Netherlands
    Personally I find the original index.html page for 'MySQL Account Maintenance' a bit confusing for users. It's a bit of a mess. Especially the 'Add Users To Your Databases:' section. So I made a cleaner version. Nothing has been changed on any cPanel includes in order to be able to change the original one with the code below withoiut negative results. Just plain HTML changes.

    File path: /usr/local/cpanel/base/frontend/x/sql/index.html

    Code:
    <cpanel setvar="headerimg=../images/topmysql.gif">
    <cpanel setvar="dprefix=../">
    <cpanel include="../stdheader.html">
    
    <script>
    function checkprivs() {
    	if (document.adduserdb.ALTER.checked == true ||
    		document.adduserdb.CREATETEMPORARYTABLES.checked == true ||
    		document.adduserdb.CREATE.checked == true ||
    		document.adduserdb.DELETE.checked == true ||
    		document.adduserdb.DROP.checked == true ||
    		document.adduserdb.SELECT.checked == true ||
    		document.adduserdb.INSERT.checked == true ||
    		document.adduserdb.UPDATE.checked == true ||
    		document.adduserdb.REFERENCES.checked == true ||
    		document.adduserdb.INDEX.checked == true ||
    		document.adduserdb.LOCKTABLES.checked == true) {
    	        document.adduserdb.ALL.checked = false;
    	}
    }
    
    function checkallprivs() {
    	if (document.adduserdb.ALL.checked == true) {
    		document.adduserdb.ALTER.checked=false;
    		document.adduserdb.CREATETEMPORARYTABLES.checked=false;
    		document.adduserdb.CREATE.checked=false;
    		document.adduserdb.DELETE.checked=false;
    		document.adduserdb.DROP.checked=false;
    		document.adduserdb.SELECT.checked=false;
    		document.adduserdb.INSERT.checked=false;
    		document.adduserdb.UPDATE.checked=false;
    		document.adduserdb.REFERENCES.checked=false;
    		document.adduserdb.INDEX.checked=false;
    		document.adduserdb.LOCKTABLES.checked=false;
    	}
    
    }
    </script>
    
                    <div align="center">
                    <font class="big">MySQL Account Maintenance</font>
                    <br><br><br>
                    <table width="550" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><hr></td>
                      </tr>
                      <tr>
                        <td align="center"><cpanel Mysql="initcache()"><table>
                          <tr>
                            <td align="center"><font class="big">Current Databases:</font></td>
                          </tr>
                          <tr>
                            <td align="center"><cpanel Mysql="listdbs()"></td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td align="center"><form action="adddb.html"><table>
                          <tr>
                            <td>New Database: <input type="text" name="db"> <input type=submit value="Create Database"></td>
                          </tr>
                        </table></form></td>
                      </tr>
                      <tr>
                        <td><hr></td>
                      </tr>
                      <tr>
                        <td align="center"><table>
                          <tr>
                            <td align="center"><font class="big">Current Users:</font></td>
                          </tr>
                          <tr>
                            <td align="center"><cpanel Mysql="listusers()"></td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td align="center"><form action="adduser.html"><table>
                          <tr>
                            <td>Username:</td>
                            <td><input type="text" name="user"></td>
                            <td></td>
                          </tr>
                          <tr>
                            <td>Password:</td>
                            <td><input type="text" name="pass"></td>
                            <td><input type="submit" value="Create User"></td>
                          </tr>
                        </table></form></td>
                      </tr>
                      <tr>
                        <td><hr></td>
                      </tr>
                      <tr>
                        <td align="center"><form action="addusertodb.html" name="adduserdb"><table>
                          <tr>
                            <td align="center" colspan="4"><font class="big">Add Users To Your Databases:</font></td>
                          </tr>
                          <tr>
                            <td colspan="4">&nbsp;</td>
                          </tr>
                          <tr>
                            <td>User:</td>
                            <td><select name=user><cpanel Mysql="listusersopt()"></select></td>
                            <td>Database:</td>
                            <td><select name=db><cpanel Mysql="listdbsopt()"></select></td>
                          </tr>
                        </table>
                        <table>
                          <tr>
                            <td colspan="5">Privileges:</td>
                          </tr>
                          <tr>
                            <td><input type=checkbox name="ALL" value="ALL" checked onClick="checkallprivs();"> ALL</td>
                            <td width="100" align="center">or</td>
                            <td width="120"><input type=checkbox name="SELECT" value="SELECT" onClick="checkprivs();"> SELECT</td>
                            <td><input type=checkbox name="CREATE" value="CREATE" onClick="checkprivs();"> CREATE</td>
                          </tr>
                          <tr>
                            <td></td>
                            <td></td>
                            <td><input type=checkbox name="INSERT" value="INSERT" onClick="checkprivs();"> INSERT</td>
                            <td><input type=checkbox name="ALTER" value="ALTER" onClick="checkprivs();"> ALTER</td>
                          </tr>
                          <tr>
                            <td></td>
                            <td></td>
                            <td><input type=checkbox name="UPDATE" value="UPDATE" onClick="checkprivs();"> UPDATE</td>
                            <td><input type=checkbox name="DROP" value="DROP" onClick="checkprivs();"> DROP</td>
                          </tr>
                          <tr>
                            <td></td>
                            <td></td>
                            <td><input type=checkbox name="DELETE" value="DELETE" onClick="checkprivs();"> DELETE</td>
                            <td><input type=checkbox name="LOCKTABLES" value="LOCK" onClick="checkprivs();"> LOCK TABLES</td>
                          </tr>
                          <tr>
                            <td></td>
                            <td></td>
                            <td><input type=checkbox name="INDEX" value="INDEX" onClick="checkprivs();"> INDEX</td>
                            <td><input type=checkbox name="REFERENCES" value="REFERENCES" onClick="checkprivs();"> REFERENCES</td>
                          </tr>
                          <tr>
                            <td></td>
                            <td></td>
                            <td colspan="2"><input type=checkbox name="CREATETEMPORARYTABLES" value="TEMPORARY" onClick="checkprivs();"> CREATE TEMPORARY TABLES</td>
                          </tr>
                        </table>
                        <table>
                          <tr>
                            <td><input type="submit" value="Add User To Database"></td>
                          </tr>
                        </table></form></td>
                      </tr>
                      <tr>
                        <td><hr></td>
                      </tr>
                      <tr>
                        <td align="center"><table>
                          <tr>
                            <td align="center"><font class="big">Access Hosts:</font></td>
                          </tr>
                          <tr>
                            <td align="center"><cpanel Mysql="listhosts()"></td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td align="center"><form action="addhost.html"><table>
                          <tr>
                            <td>Host (% wildcard is allowed):</td>
                            <td><input type="text" name="host"></td>
                            <td><input type=submit value="Add Host"></td>
                          </tr>
                        </table></form></td>
                      </tr>
    <cpanelfeature phpmyadmin>
                      <tr>
                        <td><hr></td>
                      </tr>
                      <tr>
                        <td align="center"><table>
                          <tr>
                            <td align="center"><b><a href="<cpanel Cgi="phpmyadminlink()">" target="_blank">phpMyAdmin</a></b></td>
                          </tr>
                          <tr>
                            <td align="center">You can use phpMyAdmin to administrate your MySQL databases in a web based environment.</td>
                          </tr>
                        </table></td>
                      </tr>
    </cpanelfeature>
                    </table>
                    </div>
                    <center>
                    <br><br><br>
                    <b>[</b> <a href="../index.html"><cpanel langprint="Goback"></a> <b>]</b>
                    </center>
    <cpanel include="../stdfooter.html">
    
    Note: Unfortunately after every cPanel update the edited index.html file will be replaced by the original version from the x.theme. Hopefully the developers of cPanel will add this change to the x.theme version for everybodies benefit.
     
    #1 Miquel, Aug 11, 2005
    Last edited: Aug 11, 2005
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If you want to bring it to cPanel's attention you need to log an enhancement request in bugzilla.
     
  3. brentp

    brentp Well-Known Member

    Joined:
    Mar 11, 2004
    Messages:
    324
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ayr, North Queensland, Australia
    btw; replace 'fa lse' with false in that page, its a typo. It looks pretty darned good. Nice contribution. If you dont want cpanel to overwrite the page, chattr +i it or chflags it.

    Regards,
    Brent
     
  4. Miquel

    Miquel Member

    Joined:
    Jan 19, 2004
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    The Netherlands
    The typo was generated by the "code"-option in this forum but thank you for noticing. I'm glad you found it usefull.

    I posted a request at: http://bugzilla.cpanel.net/show_bug.cgi?id=3038 for a replacement of the original sql index.html.
     
  5. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    495
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Los Angeles California
    I tink they need to lose the MySQL connection strings.
    I have more than 20 DBs on one of my account so you can just imagine how clutered it is.

    I used REGEX to hide the connection strings in my cpanel skin.
     
  6. xion

    xion Active Member

    Joined:
    Apr 6, 2003
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Very nice change. Thank you :D
     
  7. Blue|Fusion

    Blue|Fusion Well-Known Member

    Joined:
    Sep 12, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Cleveland, Ohio
    I also agree with that. No need for it really. If someone really can't figure out the code to connect, they need learn to Google better.
     
  8. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Any chance someone could give me a screenshot of this or a quick peek?

    Thanks :D
     
  9. brentp

    brentp Well-Known Member

    Joined:
    Mar 11, 2004
    Messages:
    324
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ayr, North Queensland, Australia
    apparently you need to give cpanel a 'copyright release' before they put anything of yours in, aand could cause a lot of legal problems for them and you.

    Regards,
    Brent
     
Loading...

Share This Page