1735 db_pass = escape(frm.db_pass.value.replace('+', '%2B')); |
1750 db_pass = escape(frm.db_pass.value.replace('+', '%2B')); |
1736 db_root_user = escape(frm.db_root_user.value.replace('+', '%2B')); |
1751 db_root_user = escape(frm.db_root_user.value.replace('+', '%2B')); |
1737 db_root_pass = escape(frm.db_root_pass.value.replace('+', '%2B')); |
1752 db_root_pass = escape(frm.db_root_pass.value.replace('+', '%2B')); |
1738 |
1753 |
1739 parms = 'host='+db_host+'&name='+db_name+'&user='+db_user+'&pass='+db_pass+'&root_user='+db_root_user+'&root_pass='+db_root_pass; |
1754 parms = 'host='+db_host+'&name='+db_name+'&user='+db_user+'&pass='+db_pass+'&root_user='+db_root_user+'&root_pass='+db_root_pass; |
1740 ajaxPost('<?php echo scriptPath; ?>/install.php?mode=pgsql_test', parms, function() { |
1755 ajaxPost('<?php echo scriptPath; ?>/install.php?mode=mysql_test', parms, function() { |
1741 if(ajax.readyState==4) |
1756 if(ajax.readyState==4) |
1742 { |
1757 { |
1743 s = ajax.responseText.substr(0, 4); |
1758 s = ajax.responseText.substr(0, 4); |
1744 t = ajax.responseText.substr(4, ajax.responseText.length); |
1759 t = ajax.responseText.substr(4, ajax.responseText.length); |
1745 if(s.substr(0, 4)=='good') |
1760 if(s.substr(0, 4)=='good') |
1746 { |
1761 { |
1747 document.getElementById('s_db_host').src='images/good.gif'; |
1762 document.getElementById('s_db_host').src='images/good.gif'; |
1748 document.getElementById('s_db_name').src='images/good.gif'; |
1763 document.getElementById('s_db_name').src='images/good.gif'; |
1749 document.getElementById('s_db_auth').src='images/good.gif'; |
1764 document.getElementById('s_db_auth').src='images/good.gif'; |
1750 document.getElementById('s_db_root').src='images/good.gif'; |
1765 document.getElementById('s_db_root').src='images/good.gif'; |
1751 if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = '<b>Warning:<\/b> The database you specified does not exist. It will be created during installation.'; |
1766 if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_warn_creating_db'); |
1752 if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = '<b>Warning:<\/b> The specified regular user does not exist or the password is incorrect. The user will be created during installation. If the user already exists, the password will be reset.'; |
1767 if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = $lang.get('database_msg_warn_creating_user'); |
1753 document.getElementById('s_mysql_version').src='images/good.gif'; |
1768 document.getElementById('s_mysql_version').src='images/good.gif'; |
1754 document.getElementById('e_mysql_version').innerHTML = 'Your version of PostgreSQL meets Enano requirements.'; |
1769 document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_info_mysql_good'); |
1755 } |
1770 } |
1756 else |
1771 else |
1757 { |
1772 { |
1758 switch(s) |
1773 switch(s) |
1759 { |
1774 { |
1760 case 'host': |
1775 case 'host': |
1761 document.getElementById('s_db_host').src='images/bad.gif'; |
1776 document.getElementById('s_db_host').src='images/bad.gif'; |
1762 document.getElementById('s_db_name').src='images/unknown.gif'; |
1777 document.getElementById('s_db_name').src='images/unknown.gif'; |
1763 document.getElementById('s_db_auth').src='images/unknown.gif'; |
1778 document.getElementById('s_db_auth').src='images/unknown.gif'; |
1764 document.getElementById('s_db_root').src='images/unknown.gif'; |
1779 document.getElementById('s_db_root').src='images/unknown.gif'; |
1765 document.getElementById('e_db_host').innerHTML = '<b>Error:<\/b> The database server "'+document.forms.dbinfo.db_host.value+'" couldn\'t be contacted.<br \/>'+t; |
1780 document.getElementById('e_db_host').innerHTML = $lang.get('database_msg_err_mysql_connect', { db_host: document.forms.dbinfo.db_host.value, mysql_error: t }); |
1766 document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.'; |
1781 document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version'); |
1767 break; |
1782 break; |
1768 case 'auth': |
1783 case 'auth': |
1769 document.getElementById('s_db_host').src='images/good.gif'; |
1784 document.getElementById('s_db_host').src='images/good.gif'; |
1770 document.getElementById('s_db_name').src='images/unknown.gif'; |
1785 document.getElementById('s_db_name').src='images/unknown.gif'; |
1771 document.getElementById('s_db_auth').src='images/bad.gif'; |
1786 document.getElementById('s_db_auth').src='images/bad.gif'; |
1772 document.getElementById('s_db_root').src='images/unknown.gif'; |
1787 document.getElementById('s_db_root').src='images/unknown.gif'; |
1773 document.getElementById('e_db_auth').innerHTML = '<b>Error:<\/b> Access to MySQL under the specified credentials was denied.<br \/>'+t; |
1788 document.getElementById('e_db_auth').innerHTML = $lang.get('database_msg_err_mysql_auth', { mysql_error: t }); |
1774 document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.'; |
1789 document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version'); |
1775 break; |
1790 break; |
1776 case 'perm': |
1791 case 'perm': |
1777 document.getElementById('s_db_host').src='images/good.gif'; |
1792 document.getElementById('s_db_host').src='images/good.gif'; |
1778 document.getElementById('s_db_name').src='images/bad.gif'; |
1793 document.getElementById('s_db_name').src='images/bad.gif'; |
1779 document.getElementById('s_db_auth').src='images/good.gif'; |
1794 document.getElementById('s_db_auth').src='images/good.gif'; |
1780 document.getElementById('s_db_root').src='images/unknown.gif'; |
1795 document.getElementById('s_db_root').src='images/unknown.gif'; |
1781 document.getElementById('e_db_name').innerHTML = '<b>Error:<\/b> Access to the specified database using those login credentials was denied.<br \/>'+t; |
1796 document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_err_mysql_dbperm', { mysql_error: t }); |
1782 document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.'; |
1797 document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version'); |
1783 break; |
1798 break; |
1784 case 'name': |
1799 case 'name': |
1785 document.getElementById('s_db_host').src='images/good.gif'; |
1800 document.getElementById('s_db_host').src='images/good.gif'; |
1786 document.getElementById('s_db_name').src='images/bad.gif'; |
1801 document.getElementById('s_db_name').src='images/bad.gif'; |
1787 document.getElementById('s_db_auth').src='images/good.gif'; |
1802 document.getElementById('s_db_auth').src='images/good.gif'; |
1788 document.getElementById('s_db_root').src='images/unknown.gif'; |
1803 document.getElementById('s_db_root').src='images/unknown.gif'; |
1789 document.getElementById('e_db_name').innerHTML = '<b>Error:<\/b> The specified database does not exist<br \/>'+t; |
1804 document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_err_mysql_dbexist', { mysql_error: t }); |
1790 document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.'; |
1805 document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version'); |
1791 break; |
1806 break; |
1792 case 'root': |
1807 case 'root': |
1793 document.getElementById('s_db_host').src='images/good.gif'; |
1808 document.getElementById('s_db_host').src='images/good.gif'; |
1794 document.getElementById('s_db_name').src='images/unknown.gif'; |
1809 document.getElementById('s_db_name').src='images/unknown.gif'; |
1795 document.getElementById('s_db_auth').src='images/unknown.gif'; |
1810 document.getElementById('s_db_auth').src='images/unknown.gif'; |
1796 document.getElementById('s_db_root').src='images/bad.gif'; |
1811 document.getElementById('s_db_root').src='images/bad.gif'; |
1797 document.getElementById('e_db_root').innerHTML = '<b>Error:<\/b> Access to MySQL under the specified credentials was denied.<br \/>'+t; |
1812 document.getElementById('e_db_root').innerHTML = $lang.get('database_msg_err_mysql_auth', { mysql_error: t }); |
1798 document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.'; |
1813 document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version'); |
1799 break; |
1814 break; |
1800 case 'vers': |
1815 case 'vers': |
1801 document.getElementById('s_db_host').src='images/good.gif'; |
1816 document.getElementById('s_db_host').src='images/good.gif'; |
1802 document.getElementById('s_db_name').src='images/good.gif'; |
1817 document.getElementById('s_db_name').src='images/good.gif'; |
1803 document.getElementById('s_db_auth').src='images/good.gif'; |
1818 document.getElementById('s_db_auth').src='images/good.gif'; |
1804 document.getElementById('s_db_root').src='images/good.gif'; |
1819 document.getElementById('s_db_root').src='images/good.gif'; |
1805 if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = '<b>Warning:<\/b> The database you specified does not exist. It will be created during installation.'; |
1820 if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_warn_creating_db'); |
1806 if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = '<b>Warning:<\/b> The specified regular user does not exist or the password is incorrect. The user will be created during installation. If the user already exists, the password will be reset.'; |
1821 if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = $lang.get('database_msg_warn_creating_user'); |
1807 |
1822 |
1808 document.getElementById('e_mysql_version').innerHTML = '<b>Error:<\/b> Your version of MySQL ('+t+') is older than 4.1.17. Enano will still work, but there is a known bug with the comment system and MySQL 4.1.11 that involves some comments not being displayed, due to an issue with the PHP function mysql_fetch_row().'; |
1823 document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_err_mysql_version', { mysql_version: t }); |
1809 document.getElementById('s_mysql_version').src='images/bad.gif'; |
1824 document.getElementById('s_mysql_version').src='images/bad.gif'; |
1810 default: |
1825 default: |
1811 alert(t); |
1826 alert(t); |
1812 break; |
1827 break; |
1813 } |
1828 } |