Changeset 547 for trunk/xcache.c

2008-03-15T03:02:45+01:00 (7 years ago)

more verbose and user friendly error/warning note

1 edited


  • trunk/xcache.c

    r544 r547  
    19571957    if (admin_user == NULL || admin_pass == NULL) { 
    1958         php_error_docref(NULL TSRMLS_CC, E_ERROR, "xcache.admin.user and xcache.admin.pass is required"); 
     1958        php_error_docref(XCACHE_WIKI_URL "/InstallAdministration" TSRMLS_CC, E_ERROR, 
     1959                "xcache.admin.user and/or xcache.admin.pass settings is not configured." 
     1960                " Make sure you've modified the correct php ini file for your php used in webserver."); 
    19591961        zend_bailout(); 
    19601962    } 
    19611963    if (strlen(admin_pass) != 32) { 
    1962         php_error_docref(NULL TSRMLS_CC, E_ERROR, "unexpect %lu bytes of xcache.admin.pass, expected 32 bytes, the password after md5()", (unsigned long) strlen(admin_pass)); 
     1964        php_error_docref(NULL TSRMLS_CC, E_ERROR, "xcache.admin.pass is %lu chars unexpectedly, it is supposed to be the password after md5() which should be 32 chars", (unsigned long) strlen(admin_pass)); 
    19631965        zend_bailout(); 
    19641966    } 
    20092011    sapi_add_header_ex(STR, sizeof(STR) - 1, 1, 1 TSRMLS_CC); 
    20102012#undef STR 
    2011     ZEND_PUTS("XCache Auth Failed. User and Password is case sense\n"); 
     2013#define STR "Content-type: text/html; charset=UTF-8" 
     2014    sapi_add_header_ex(STR, sizeof(STR) - 1, 1, 1 TSRMLS_CC); 
     2015#undef STR 
     2016    ZEND_PUTS("<html>\n"); 
     2017    ZEND_PUTS("<head><title>XCache Authentication Failed</title></head>\n"); 
     2018    ZEND_PUTS("<body>\n"); 
     2019    ZEND_PUTS("<h1>XCache Authentication Failed</h1>\n"); 
     2020    ZEND_PUTS("<p>You're not authorized to access this page due to wrong username and/or password you typed.<br />The following check points is suggested:</p>\n"); 
     2021    ZEND_PUTS("<ul>\n"); 
     2022    ZEND_PUTS("<li>Be aware that `Username' and `Password' is case sense. Check capslock status led on your keyboard, and punch left/right Shift keys once for each</li>\n"); 
     2023    ZEND_PUTS("<li>Make sure the md5 password is generated correctly. You may use <a href=\"mkpassword.php\">mkpassword.php</a></li>\n"); 
     2024    ZEND_PUTS("<li>Reload browser cache by pressing F5 and/or Ctrl+F5, or simply clear browser cache after you've updated username/password in php ini.</li>\n"); 
     2025    ZEND_PUTS("</ul>\n"); 
     2026    ZEND_PUTS("Check <a href=\"" XCACHE_WIKI_URL "/InstallAdministration\">XCache wiki page</a> for more information.\n"); 
     2027    ZEND_PUTS("</body>\n"); 
     2028    ZEND_PUTS("</html>\n"); 
    20132030    zend_bailout(); 
Note: See TracChangeset for help on using the changeset viewer.