Results 1 to 2 of 2

Thread: dbpassword function

  1. #1
    deemurphyus is offline Sugar Community Member
    Join Date
    Nov 2006
    Posts
    27

    Default dbpassword function

    I am installing timesheet.php to use with Sugar4.5 Open Source.

    Has anyone used the new timesheet.php? How do I incorporate it into Sugar so it can be seen on the dashboard?

    I also am having a problem logging in, here is the code and the results:

    I thought it would help if I post the code and the error I am getting.

    Code:

    <?php

    $DATABASE_HOST = "localhost";
    $DATABASE_USER = "root";
    $DATABASE_PASS = "mypassword";
    $DATABASE_DB = "sugarcrm";
    $DATABASE_PASSWORD_FUNCTION = "__DBPASSWORDFUNCTION__";

    Error:

    Can't perform query: FUNCTION sugarcrm.__DBPASSWORDFUNCTION__ does not exist
    SELECT password AS passwd1, __DBPASSWORDFUNCTION__('mypassword') AS passwd2 FROM timesheet_user WHERE username='admin'

    ?>

    Admin is the timesheet username. I am using timesheet.php and put the database in sugarcrm. The password for all is the same.

    Thank you
    Dee

  2. #2
    uoa7 is offline Junior Member
    Join Date
    Jul 2008
    Posts
    1

    Wink Re: dbpassword function

    Hello, your problem is the non-existant function __DBPASSWORDFUNCTION__ as you might have figured from the Error message. Try replacing with

    Code:
    $DATABASE_PASSWORD_FUNCTION = "PASSWORD";
    which will result in this sql statement

    Code:
    SELECT password AS passwd1, PASSWORD('mypassword') AS passwd2 FROM timesheet_user WHERE username='admin'
    which is valid.

    You may also choose to use a different password function such as md5 or sha1 but if you followed the manual install you will notice the default password is hashed with PASSWORD

    Code:
    INSERT INTO user VALUES ('admin', 10, PASSWORD('mypassword'), '.*', 'Timesheet', 'Admin', '', '', '0.00', '', 'OUT', '1');
    Hope this is helpful to someone, even though it's 2 years late.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •