diff options
author | Robin Appelman <icewind1991@gmail.com> | 2010-09-05 14:12:18 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2010-09-05 14:12:18 +0200 |
commit | c7e707c381208b352c7056d72eacd17647c9abbf (patch) | |
tree | f8ce498c484d477fd10dc29c73c74325659596e8 /inc/templates | |
parent | 37aa05abe53c317de841cd24a283a8629a3795f2 (diff) | |
parent | 6fede6be6666bdc53553745de5c66681308df0b6 (diff) | |
download | nextcloud-server-c7e707c381208b352c7056d72eacd17647c9abbf.tar.gz nextcloud-server-c7e707c381208b352c7056d72eacd17647c9abbf.zip |
merge
Diffstat (limited to 'inc/templates')
-rwxr-xr-x[-rw-r--r--] | inc/templates/adminform.php | 164 | ||||
-rwxr-xr-x[-rw-r--r--] | inc/templates/settings.php | 3 |
2 files changed, 110 insertions, 57 deletions
diff --git a/inc/templates/adminform.php b/inc/templates/adminform.php index 0a892d7d4bc..e421eac31e8 100644..100755 --- a/inc/templates/adminform.php +++ b/inc/templates/adminform.php @@ -16,39 +16,63 @@ $newuserpassword=OC_USER::generatepassword(); ?> <script type="text/javascript"> function showDBAdmin(){ - var show=document.getElementById('dbcreate').checked; - document.getElementById('dbAdminUser').style.display=(show)?'table-row':'none'; - document.getElementById('dbAdminPwd').style.display=(show)?'table-row':'none'; + var show=document.getElementById('dbcreate').checked; + document.getElementById('dbAdminUser').style.display=(show)?'table-row':'none'; + document.getElementById('dbAdminPwd').style.display=(show)?'table-row':'none'; } function showBackupPath(){ - var show=document.getElementById('enablebackup').checked; - document.getElementById('backupdir').style.display=(show)?'table-row':'none'; + var show=document.getElementById('enablebackup').checked; + document.getElementById('backupdir').style.display=(show)?'table-row':'none'; } function dbtypechange(){ - var dropdown=action=document.getElementById('dbtype'); - var type=dropdown.options[dropdown.selectedIndex].value; - var inputs=Array('dbhost','dbuser','dbpass','dbpass_retype','dbcreaterow','dbAdminPwd','dbAdminUser','dbname','dbfill','dbtableprefix'); - var id,element; - if(type=='sqlite'){ - for(i in inputs){ - id=inputs[i]; - element=document.getElementById(id); - if(element){ - element.style.display='none'; - } - } - }else if(type=='mysql' || type=='pgsql'){ - for(i in inputs){ - id=inputs[i]; - element=document.getElementById(id); - if(element){ - element.style.display='table-row'; - } - } - showDBAdmin() - } + var dropdown=action=document.getElementById('dbtype'); + if (dropdown){ + var type=dropdown.options[dropdown.selectedIndex].value; + var inputs=Array('dbhost','dbuser','dbpass','dbpass_retype','dbcreaterow','dbAdminPwd','dbAdminUser','dbname','dbfill','dbtableprefix'); + var id,element; + if(type=='sqlite'){ + for(i in inputs){ + id=inputs[i]; + element=document.getElementById(id); + if(element){ + element.style.display='none'; + } + } + }else if(type=='mysql' || type=='pgsql'){ + for(i in inputs){ + id=inputs[i]; + element=document.getElementById(id); + if(element){ + element.style.display='table-row'; + } + } + showDBAdmin(); + } + } +} + +function datetypechange(){ + var dropdown=action=document.getElementById('datetype'); + var type=dropdown.options[dropdown.selectedIndex].value; + + var id,element; + if(type=='custom'){ + element=document.getElementById('trdateformat'); + if(element){ + element.style.display='table-row'; + } + }else{ + element=document.getElementById('trdateformat'); + if(element){ + element.style.display='none'; + } + element=document.getElementById('inputdateformat'); + if(element){ + element.value = type; + } + } } </script> <?php @@ -64,28 +88,48 @@ echo('<form method="post" action="'.$action.'">') if(!empty($CONFIG_ERROR) and !$FIRSTRUN){ echo "<tr><td colspan='3' class='error'>$CONFIG_ERROR</td></tr>"; } - if(!$FIRSTRUN){?> - <tr><td>current password</td><td><input type="password" name="currentpassword" size="30" class="formstyle"></input></td></tr> - <?php - } if($FIRSTRUN){?> -<tr><td>admin login:</td><td><input type="text" name="adminlogin" size="30" class="formstyle" value=""></input></td></tr> -<tr><td>admin password:</td><td><input type="password" name="adminpassword" size="30" class="formstyle"></input></td><td>(leave empty to keep current password)</td></tr> -<tr><td>retype admin password:</td><td><input type="password" name="adminpassword2" size="30" class="formstyle"></input></td></tr> -<tr><td>data directory:</td><td><input type="text" name="datadirectory" size="30" class="formstyle" value="<?php echo($CONFIG_DATADIRECTORY_ROOT);?>"></input></td></tr> +<tr><th colspan="2">Administartor User</th></tr> +<tr title="Name used to log in."><td>user name:</td><td><input type="text" name="adminlogin" size="30" class="formstyle" value=""></input></td></tr> +<tr title="Make a secure password, use at least 9 characters. Use letters and numbers."><td>password:</td><td><input type="password" name="adminpassword" size="30" class="formstyle"></input></td></tr> +<tr title="Retype password to avoid typing errors."><td>retype password:</td><td><input type="password" name="adminpassword2" size="30" class="formstyle"></input></td></tr> <?php } ?> -<tr><td>force ssl:</td><td><input type="checkbox" name="forcessl" size="30" class="formstyle" value='1' <?php if($CONFIG_HTTPFORCESSL) echo 'checked="checked"'?>></input></td></tr> -<tr><td>enable automatic backup:</td><td><input type="checkbox" name="enablebackup" id="enablebackup" onchange='showBackupPath()' size="30" class="formstyle" value='1' <?php if($CONFIG_ENABLEBACKUP) echo 'checked'?>></input></td></tr> -<tr id='backupdir'><td>backup directory:</td><td><input type="text" name="backupdirectory" size="30" class="formstyle" value="<?php echo($CONFIG_BACKUPDIRECTORY);?>"></input></td></tr> -<tr><td>date format:</td><td><input type="text" name="dateformat" size="30" class="formstyle" value='<?php echo($CONFIG_DATEFORMAT);?>'></input></td></tr> +<tr><th colspan="2">Advanced Configurations</th></tr> +<?php if($FIRSTRUN){?> +<tr title="This directory is used to store files."><td>data directory:</td><td><input type="text" name="datadirectory" size="30" class="formstyle" value="<?php echo($CONFIG_DATADIRECTORY_ROOT);?>"></input></td></tr> +<?php } ?> +<tr title="Using SSL is more secure but requires specific configurations. Click the link to test SSL on your server."><td>force ssl: (<a href="https://<?php echo($_SERVER["HTTP_HOST"].$WEBROOT);?>" target="_blank">test SLL</a>)</td><td><input type="checkbox" name="forcessl" size="30" class="formstyle" value='1' <?php if($CONFIG_HTTPFORCESSL) echo 'checked="checked"'?>></input></td></tr> +<tr title="If something goes wrong, it is often possible to protect your data using a back-up."><td>automatic backup:</td><td><input type="checkbox" name="enablebackup" id="enablebackup" onchange='showBackupPath()' size="30" class="formstyle" value='1' <?php if($CONFIG_ENABLEBACKUP) echo 'checked'?>></input></td></tr> +<tr title="This directory is used to store backups." id='backupdir'><td> - backup directory:</td><td><input type="text" name="backupdirectory" size="30" class="formstyle" value="<?php echo($CONFIG_BACKUPDIRECTORY);?>"></input></td></tr> +<tr><td>date format:</td><td><select id='datetype' name="datetype" onchange='datetypechange()'> + <option value='<?php echo($CONFIG_DATEFORMAT);?>'><?php echo(date($CONFIG_DATEFORMAT));?></option> + <!-- dd-mm-yyyy yyyy-mm-dd mm-dd-yyyy --> + <optgroup label="DD-MM-YYYY"> + <option value='j M Y G:i'><?php echo(date('j M Y G:i'));?></option> + <option value='j M Y'><?php echo(date('j M Y'));?></option> + <option value='D j M Y G:i:s'><?php echo(date('D j M Y G:i:s'));?></option> + <option value='l j F'><?php echo(date('l j F'));?></option> + <option value='d-m-Y G:i'><?php echo(date('d-m-Y H:i'));?></option> + </optgroup> + <optgroup label="MM-DD-YYYY"> + <option value='M j Y G:i'><?php echo(date('M j Y G:i'));?></option> + <option value='M j Y'><?php echo(date('M j Y'));?></option> + </optgroup> + <optgroup label="YYYY-MM-DD"> + <option value='Y M j G:i'><?php echo(date('Y M j G:i'));?></option> + <option value='Y M j'><?php echo(date('Y M j'));?></option> + </optgroup> + <option value='custom'>Custom Date</option> +</select></td></tr> +<tr id='trdateformat'><td> - custom date:</td><td><input type="text" id="inputdateformat" name="dateformat" size="30" class="formstyle" value='<?php echo($CONFIG_DATEFORMAT);?>'></input></td></tr> <?php if($FIRSTRUN){ if(!is_callable('sqlite_open')){ echo '<tr><td colspan="2">No SQLite support detected, make sure you have both sqlite and the sqlite php module installed (sqlite and php5-sqlite for Debian/Ubuntu)</td></tr>'; } ?> -<tr><td>database type:</td><td> +<tr title="SQLite is usually the easiest database to work with."><td>database type:</td><td> <select id='dbtype' name="dbtype" onchange='dbtypechange()'> <?php global $CONFIG_DBTYPE; @@ -123,27 +167,34 @@ if($CONFIG_DBTYPE=='sqlite'){ ?> </select> </td></tr> -<tr id='dbhost'><td>database host:</td><td><input type="text" name="dbhost" size="30" class="formstyle" value='<?php echo($CONFIG_DBHOST);?>'></input></td></tr> -<tr id='dbname'><td>database name:</td><td><input type="text" name="dbname" size="30" class="formstyle" value='<?php echo($CONFIG_DBNAME);?>'></input></td></tr> -<tr id='dbtableprefix'><td>database table prefix:</td><td><input type="text" name="dbtableprefix" size="30" class="formstyle" value='<?php echo($CONFIG_DBTABLEPREFIX);?>'></input></td></tr> -<tr id='dbuser'><td>database user:</td><td><input type="text" name="dbuser" size="30" class="formstyle" value='<?php echo($CONFIG_DBUSER);?>'></input></td></tr> -<tr id='dbpass'><td>database password:</td><td><input type="password" name="dbpassword" size="30" class="formstyle" value=''></input></td><td>(leave empty to keep current password)</td></tr> -<tr id='dbpass_retype'><td>retype database password:</td><td><input type="password" name="dbpassword2" size="30" class="formstyle" value=''></input></td></tr> -<tr id='dbcreaterow'><td>create database and user:</td><td><input id='dbcreate' type="checkbox" name="createdatabase" size="30" class="formstyle" value='1' <?php if($FIRSTRUN) echo 'checked="checked"'; ?> onchange='showDBAdmin()'></input></td></tr> -<tr id='dbAdminUser'><td>database administrative user:</td><td><input type="text" name="dbadminuser" size="30" class="formstyle" value='root'></input></td></tr> -<tr id='dbAdminPwd'><td>database administrative password:</td><td><input type="password" name="dbadminpwd" size="30" class="formstyle" value=''></input></td></tr> -<tr id='dbfill'><td>automaticly fill initial database:</td><td><input type="checkbox" name="filldb" size="30" class="formstyle" value='1' <?php if($FIRSTRUN) echo 'checked="checked"'; ?>></input></td></tr> +<tr title="The database server. In most cases, localhost works fine." id='dbhost'><td> - database host:</td><td><input type="text" name="dbhost" size="30" class="formstyle" value='<?php echo($CONFIG_DBHOST);?>'></input></td></tr> +<tr title="The name of the database." id='dbname'><td> - database name:</td><td><input type="text" name="dbname" size="30" class="formstyle" value='<?php echo($CONFIG_DBNAME);?>'></input></td></tr> +<tr title="Used to avoid conflict between web-applications. Don't use the same prefix for two web-applications." id='dbtableprefix'><td> - table prefix:</td><td><input type="text" name="dbtableprefix" size="30" class="formstyle" value='<?php echo($CONFIG_DBTABLEPREFIX);?>'></input></td></tr> +<tr title="The user of the database. If possible avoid the root user." id='dbuser'><td> - database user:</td><td><input type="text" name="dbuser" size="30" class="formstyle" value='<?php echo($CONFIG_DBUSER);?>'></input></td></tr> +<tr title="The password of the database." id='dbpass'><td> - password:</td><td><input type="password" name="dbpassword" size="30" class="formstyle" value=''></input></td></tr> +<tr title="Retype password to avoid typing errors." id='dbpass_retype'><td> - retype password:</td><td><input type="password" name="dbpassword2" size="30" class="formstyle" value=''></input></td></tr> +<tr title="Automatically create a database and user for ownCloud." id='dbcreaterow'><td> - create database and user:</td><td><input id='dbcreate' type="checkbox" name="createdatabase" size="30" class="formstyle" value='1' checked="checked" onchange='showDBAdmin()'></input></td></tr> +<tr title="The administrative database user. This is often 'root'. If in doubt, contact your web-host" id='dbAdminUser'><td> - administrative user:</td><td><input type="text" name="dbadminuser" size="30" class="formstyle" value='root'></input></td></tr> +<tr title="The password of the administrative database user. If in doubt, contact your web-host." id='dbAdminPwd'><td> - administrative password:</td><td><input type="password" name="dbadminpwd" size="30" class="formstyle" value=''></input></td></tr> +<tr title="Fill database with default data so you can start right away." id='dbfill'><td> - fill initial database:</td><td><input type="checkbox" name="filldb" size="30" class="formstyle" value='1' checked="checked"></input></td></tr> <?php }?> -<tr><td></td><td><input type="submit" name='set_config' alt="save" value="save" class="formstyle" /></td></tr> +<tr><th colspan="2">Conformation</th></tr> +<?php + if(!$FIRSTRUN){?> + <tr title="This is to avoid abuse while you are away and have not logged out decently."><td>your password:</td><td><input type="password" name="currentpassword" size="30" class="formstyle"></input></td></tr> + <?php + } +?> +<tr><td></td><td><input type="submit" name="set_config" alt="save" value="save" class="formstyle" /></td></tr> </table></form><br/> <?php if(!$FIRSTRUN ){//disabled for now?> <br/> <form method="post" enctype="multipart/form-data" action="#"> <table cellpadding="5" cellspacing="5" border="0" class="loginform"> -<tr><td colspan='2'>Create new user:</td></tr> -<tr><td>user name</td><td><input type='text' name='new_username' class="formstyle"></input></td></tr> -<tr><td>password</td><td><input type='text' name='new_password' class="formstyle" autocomplete="off" value='<?php echo($newuserpassword);?>'></input></td></tr> +<tr><th colspan='2'>Create new user:</td></tr> +<tr title="Name used to log in."><td>user name</td><td><input type='text' name='new_username' class="formstyle"></input></td></tr> +<tr title="Make a secure password, use at least 9 characters. Use letters and numbers."><td>password</td><td><input type='text' name='new_password' class="formstyle" autocomplete="off" value='<?php echo($newuserpassword);?>'></input></td></tr> <tr><td></td><td><input type='submit' value='create' class="formstyle"></input></td></tr> </table> </form> @@ -151,6 +202,7 @@ if(!$FIRSTRUN ){//disabled for now?> } ?> <script type="text/javascript"> - dbtypechange() - showBackupPath() + dbtypechange(); + datetypechange(); + showBackupPath(); </script> diff --git a/inc/templates/settings.php b/inc/templates/settings.php index 9a1876f98a1..5df6b70f5af 100644..100755 --- a/inc/templates/settings.php +++ b/inc/templates/settings.php @@ -26,9 +26,10 @@ function hideAllForms(){ <div id='settingsNav'> <ul> <?php +global $WEBROOT; foreach(OC_CONFIG::$forms as $name=>$url){ $clean=strtolower(str_replace(' ','_',$name)); - echo("<li><a onclick='showForm(\"$clean\")' href='settings/#$clean'>$name</a></li>\n"); + echo("<li><a onclick='showForm(\"$clean\")' href='{$WEBROOT}/settings/#$clean'>$name</a></li>\n"); } ?> </ul> |