[Xerte] Re: Xerte Online Toolkits: Installation Guide

Pat Lockley patrick.lockley at googlemail.com
Fri Jan 6 20:38:34 GMT 2012


or this one

On Fri, Jan 6, 2012 at 8:31 PM, Pat Lockley
<patrick.lockley at googlemail.com> wrote:
> use this switch.txt instead
>
> On Fri, Jan 6, 2012 at 3:35 PM, Pat Lockley
> <patrick.lockley at googlemail.com> wrote:
>> i knew / suspected the page wouldn't work.
>>
>> Will have a look later as to why (php errors)
>>
>> On Fri, Jan 6, 2012 at 3:17 PM, MTG Judge Course <info at mtgjc.com> wrote:
>>> Yeah, I tried that, and was able to get past the login screen, but
>>> everything comes up blank. (Once I log in, /xerte/index.php is blank.)
>>>
>>> Sigh... I'm beginning to think the universe is working against me on this
>>> one.
>>>
>>> -----Original Message-----
>>> From: xerte-bounces at lists.nottingham.ac.uk
>>> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Pat Lockley
>>> Sent: Friday, January 06, 2012 9:56 AM
>>> To: Xerte discussion list
>>> Subject: [Xerte] Re: Xerte Online Toolkits: Installation Guide
>>>
>>> In the zip root folder is a file called switch.txt which you can replace
>>> index.php with if you've not got LDAP.
>>>
>>> Edit switch.txt and you'll see the passwords and such like.
>>>
>>> I'm not sure it works at present, so try renaming switch.txt to index.php.
>>>
>>> On Fri, Jan 6, 2012 at 2:49 PM, MTG Judge Course <info at mtgjc.com> wrote:
>>>> Thanks everyone for your help with this! It actually turned out that
>>>> the problem was a permissions setting with the database that GoDaddy
>>>> had to fix... I guess that's why all the searching for an issue on my
>>>> end turned up nothing! This is a recurring problem, I understand, with
>>>> having a shared hosting account.
>>>>
>>>> I was able after that to complete the install of Xerte, but I do not
>>>> have LDAP, and I was wondering if there were instructions somewhere
>>>> about how to install without LDAP. This installation of Xerte will
>>>> only be used by one or two people, and using the same authentication,
>>>> so I'm hoping to be able to bypass LDAP.
>>>>
>>>> Any help would be gratefully received! :)
>>>>
>>>> -----Original Message-----
>>>> From: xerte-bounces at lists.nottingham.ac.uk
>>>> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Pat Lockley
>>>> Sent: Wednesday, January 04, 2012 2:12 PM
>>>> To: Xerte discussion list
>>>> Subject: [Xerte] Re: Xerte Online Toolkits: Installation Guide
>>>>
>>>> i would suggest something like this
>>>>
>>>> <?PHP
>>>>
>>>> include "database.php";
>>>>
>>>> $response = mysql_connect(settings from database.php);
>>>>
>>>> print_r($response);
>>>>
>>>> ?>
>>>>
>>>> Save that in a php file in the root directory
>>>>
>>>> On Wed, Jan 4, 2012 at 6:59 PM, MTG Judge Course <info at mtgjc.com> wrote:
>>>>> LOL. Too true!! =)
>>>>>
>>>>> Yes, I'm decent with PHP, but not expert, and I fear I've surpassed
>>>>> the limits of my ability to scour the PHP for where the problem might
>>> lie.
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: xerte-bounces at lists.nottingham.ac.uk
>>>>> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Pat
>>>>> Lockley
>>>>> Sent: Wednesday, January 04, 2012 11:28 AM
>>>>> To: Xerte discussion list
>>>>> Subject: [Xerte] Re: Xerte Online Toolkits: Installation Guide
>>>>>
>>>>> Yep, it should all work, but then if it should all work I can't think
>>>>> what to suggest to help.
>>>>>
>>>>> Are you ok with PHP?
>>>>>
>>>>> On Wed, Jan 4, 2012 at 3:37 PM, MTG Judge Course <info at mtgjc.com> wrote:
>>>>>> I set the host, username, and password in the installation steps.
>>>>>> The installer was able to create the database in the proper place
>>>>>> using this information. So unless I'm really confused, that should
>>>>>> mean that the host, username, and password are all correct, and that
>>>>>> the user has the appropriate rights to the database??
>>>>>>
>>>>>> The host and username are below. I'm omitting certain pieces of
>>>>>> information since I believe these list communications are publicly
>>>>> accessible.
>>>>>>
>>>>>> Host: mtg1*7.db.8777228.hostedresource.com
>>>>>> Username: mtg1*7
>>>>>> Password: ***** [my password that works when accessing the db via
>>>>>> PHPMyAdmin or ODBC connection]
>>>>>>
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: xerte-bounces at lists.nottingham.ac.uk
>>>>>> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Pat
>>>>>> Lockley
>>>>>> Sent: Wednesday, January 04, 2012 10:25 AM
>>>>>> To: Xerte discussion list
>>>>>> Subject: [Xerte] Re: Xerte Online Toolkits: Installation Guide
>>>>>>
>>>>>> Ok,
>>>>>>
>>>>>> It might be the host details - what is the host set as?
>>>>>>
>>>>>> Pat
>>>>>>
>>>>>> On Wed, Jan 4, 2012 at 3:19 PM, MTG Judge Course <info at mtgjc.com> wrote:
>>>>>>> Thanks so much for your response. I've checked the database.php
>>>>>>> file, and all appears to be correct. I have a GoDaddy basic
>>>>>>> account, so I cannot create more than one user for each database. I
>>>>>>> only have one username and password, and that username of course
>>>>>>> has full access of every type to the database.
>>>>>>>
>>>>>>> Note that during setup, this same username/password was used to
>>>>>>> *create* the database tables. Everything appeared to be working
>>>>>>> perfectly until I tried to use Xerte and it gave me that error message.
>>>>>>>
>>>>>>> Blargh! :)
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: xerte-bounces at lists.nottingham.ac.uk
>>>>>>> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Pat
>>>>>>> Lockley
>>>>>>> Sent: Tuesday, January 03, 2012 2:30 PM
>>>>>>> To: Xerte discussion list
>>>>>>> Subject: [Xerte] Re: Xerte Online Toolkits: Installation Guide
>>>>>>>
>>>>>>> The username in database.php isn't allowed to access the database
>>>>>>> the installer created
>>>>>>>
>>>>>>> If you have cPanel check to see if the account you're using in
>>>>>>> database.php has select,delete,insert and update privileges for
>>>>>>> that
>>>>>> database.
>>>>>>>
>>>>>>> On Tue, Jan 3, 2012 at 7:23 PM, MTG Judge Course <info at mtgjc.com>
>>> wrote:
>>>>>>>> I tried to install Xerte online and ran into a roadblock. I
>>>>>>>> followed all the installation directions to the letter, and the
>>>>>>>> installation script successfully created all the Xerte tables in
>>>>>>>> the database I’d set
>>>>>>> up for it.
>>>>>>>> However, when I try to access the Xerte installation, it says:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> “Sorry, the system cannot connect to the database at present. The
>>>>>>>> mysql error is Access denied for user 'mtg5[..]8'@'184.[..].193'
>>>>>>>> (using
>>>>>>> password:
>>>>>>>> YES)”
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> My website is hosted through GoDaddy.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks!!!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> This message and any attachment are intended solely for the
>>>>>>>> addressee and may contain confidential information. If you have
>>>>>>>> received this message in error, please send it back to me, and
>>>>>>>> immediately delete it. Please do not use, copy or disclose the
>>>>>>>> information contained in this message or in any attachment. Any
>>>>>>>> views or opinions expressed by the author of this email do not
>>>>>>>> necessarily reflect the views of the
>>>>>>> University of Nottingham.
>>>>>>>>
>>>>>>>> This message has been checked for viruses but the contents of an
>>>>>>>> attachment may still contain software viruses which could damage
>>>>>>>> your
>>>>>>> computer system:
>>>>>>>> you are advised to perform your own checks. Email communications
>>>>>>>> with the University of Nottingham may be monitored as permitted by
>>>>>>>> UK
>>>>>>> legislation.
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Xerte mailing list
>>>>>>>> Xerte at lists.nottingham.ac.uk
>>>>>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>>>>>
>>>>>>>> This message and any attachment are intended solely for the
>>>>>>>> addressee and may contain confidential information. If you have
>>>>>>>> received this message in error, please send it back to me, and
>>>>>>>> immediately delete it.   Please do not use, copy or disclose the
>>>>>>>> information contained in this message or in any attachment.  Any
>>>>>>>> views or opinions expressed by the author of this email do not
>>>>>>>> necessarily reflect the views of the
>>>>>>> University of Nottingham.
>>>>>>>>
>>>>>>>> This message has been checked for viruses but the contents of an
>>>>>>>> attachment may still contain software viruses which could damage
>>>>>>>> your
>>>>>>> computer system:
>>>>>>>> you are advised to perform your own checks. Email communications
>>>>>>>> with the University of Nottingham may be monitored as permitted by
>>>>>>>> UK
>>>>>>> legislation.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Xerte mailing list
>>>>>>> Xerte at lists.nottingham.ac.uk
>>>>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Xerte mailing list
>>>>>>> Xerte at lists.nottingham.ac.uk
>>>>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>>>
>>>>>> _______________________________________________
>>>>>> Xerte mailing list
>>>>>> Xerte at lists.nottingham.ac.uk
>>>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Xerte mailing list
>>>>>> Xerte at lists.nottingham.ac.uk
>>>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>>
>>>>> _______________________________________________
>>>>> Xerte mailing list
>>>>> Xerte at lists.nottingham.ac.uk
>>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Xerte mailing list
>>>>> Xerte at lists.nottingham.ac.uk
>>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>
>>>> _______________________________________________
>>>> Xerte mailing list
>>>> Xerte at lists.nottingham.ac.uk
>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>>
>>>>
>>>> _______________________________________________
>>>> Xerte mailing list
>>>> Xerte at lists.nottingham.ac.uk
>>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>
>>> _______________________________________________
>>> Xerte mailing list
>>> Xerte at lists.nottingham.ac.uk
>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>
>>>
>>> _______________________________________________
>>> Xerte mailing list
>>> Xerte at lists.nottingham.ac.uk
>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
-------------- next part --------------
<?php

// This file could be used instead of index.php to perform authentication. 
// The list of usernames/passwords are hard coded below.  (search for 'sarah')

require("config.php");

/**
 * 
 * Login page, self posts to become management page
 *
 * @author Patrick Lockley
 * @version 1.0
 * @copyright Copyright (c) 2008,2009 University of Nottingham
 * @package
 */

include $xerte_toolkits_site->php_library_path . "login_library.php";

include $xerte_toolkits_site->php_library_path . "display_library.php";

/**
 *  Check to see if anything has been posted to distinguish between log in attempts
 */

if((!isset($_POST["login"]))&&(!isset($_POST["password"]))){

    $buffer = login_page_format_top(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_top"));

    $buffer .= $form_string;

    $buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));

    echo $buffer;

}

/*
 * Some data has bee posted, interpret as attempt to login
 */

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    /**
     * Username and password left empty
     */

    if(($_POST["login"]=="")&&($_POST["password"]=="")){

        $buffer = login_page_format_top(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_top"));

        $buffer .= "<p>Please enter your username and password</p>";

        $buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));	

        echo $buffer;

        /*
         * Username left empty
         */

    }else if($_POST["login"]==""){

        $buffer = login_page_format_top(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_top"));

        $buffer .= "<p>Please enter your username</p>";

        $buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));	

        echo $buffer;

        /*
         * Password left empty
         */

    }else if($_POST["password"]==""){

        $buffer = login_page_format_top(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_top"));

        $buffer .= "<p>Please enter your password</p>";

        $buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));

        echo $buffer;

        /*
         * Password and username provided, so try to authenticate
         */

    }else if(($_POST["login"]!="")&&($_POST["password"]!="")){

        /*
         * See if the submitted values are valid logins
         */

        $authenticated = false;

        function set_user_details($firstname, $surname){

            $_SESSION['toolkits_firstname'] = $firstname;
            $_SESSION['toolkits_surname'] = $surname;

        }

        switch($_POST["login"]){

            case "pat": if($_POST["password"]=="patpassword"){ $authenticated = true; set_user_details("Pat","Blair");}; break;
            case "john": if($_POST["password"]=="johnpassword"){ $authenticated = true; set_user_details("John","Obama"); }; break;
            case "bob": if($_POST["password"]=="bobpassword"){ $authenticated = true; set_user_details("Bob","Putin"); }; break;
            case "sarah": if($_POST["password"]=="sarahpassword"){ $authenticated = true; set_user_details("Sarah","Sarkozy"); }; break;
            default: $authenticated = false; break;

        }

        if($authenticated){
		
            /*
             * Give the session its own session id
             */		

            $_SESSION['toolkits_sessionid'] = $session_id; 

            include $xerte_toolkits_site->php_library_path . "user_library.php";

            $mysql_id=database_connect("index.php database connect success","index.php database connect fail");			

            $_SESSION['toolkits_logon_username'] = $_POST["login"];

            /*
             * Check to see if this is a users' first time on the site
             */

            if(check_if_first_time($_SESSION['toolkits_logon_username'])){

                /*
                 *	create the user a new id			
                 */

                $_SESSION['toolkits_logon_id'] = create_user_id($_SESSION['toolkits_logon_username'], $_SESSION['toolkits_firstname'], $_SESSION['toolkits_surname']);

                /*
                 *   create a virtual root folder for this user
                 */

                create_a_virtual_root_folder();			

            }else{

                /*
                 * User exists so update the user settings
                 */

                $_SESSION['toolkits_logon_id'] = get_user_id();

                update_user_logon_time();

            }

            recycle_bin();		

            /*
             * Output the main page, including the user's and blank templates
             */

            echo file_get_contents($xerte_toolkits_site->website_code_path . "management_headers");

            echo "<script type=\"text/javascript\"> // JAVASCRIPT library for fixed variables\n // management of javascript is set up here\n // SITE SETTINGS\n";

            echo "var site_url = \"" . $xerte_toolkits_site->site_url .  "\";\n";

            echo "var site_apache = \"" . $xerte_toolkits_site->apache .  "\";\n";

            echo "var properties_ajax_php_path = \"website_code/php/properties/\";\n var management_ajax_php_path = \"website_code/php/management/\";\n var ajax_php_path = \"website_code/php/\";\n";

            echo file_get_contents($xerte_toolkits_site->website_code_path . "management_top");

            list_users_projects("data_down");

            echo logged_in_page_format_middle(file_get_contents($xerte_toolkits_site->website_code_path . "management_middle"));

            list_blank_templates();

            echo file_get_contents($xerte_toolkits_site->website_code_path . "management_bottom");

        }else{

            /*
             * login has failed
             */

            $buffer = login_page_format_top(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_top"));

            $buffer .= "<p>Sorry that password combination was not correct</p>";

            $buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));	

            echo $buffer;	

        }

    }

}

?>	
</body>
</html>


More information about the Xerte mailing list