1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. A serious FreePBX vulnerability has been reported. Update your Framework Module immediately. Click here for details.

GO HERE timeclock application

Discussion in 'Add-On Install Instructions' started by mac, Apr 18, 2009.

Thread Status:
Not open for further replies.
  1. mac New Member

    John Mullinix and I wrote this for a customer a few months back and I keep forgetting to post it.

    Basically we are using phpTimeclock and creating a dialplan for users to punch in and out. Instructions are in the zip along with some sound files and an icon. It has been working at a customer site of 20 people for 2 months now.

    Ed Macri

    Attached Files:

  2. gaijin Guru

    WOW!

    I've been looking for something like this!

    I will install tonight and see how it goes!
  3. ou812 Guru

    I followed the install instruction and all seemed to work but when i click the icon in the Kennon menu it displays
    Error: Could not connect to the database. Please try again later.
    this is what I have in htindex.cfg 2,timeclock,./phptimeclock,Timeclock,clock.png
    as this is my first time creating a database & user I must have done something wrong. not sure what it might be, I ran the 2 commands chown & chgrp I also gave the privileges to the user in phpmyadmin.
    timeclock % global SELECT, INSERT, UPDATE, DELETE, CREATE Yes [IMG]if someone could point me in the right direction it would be help full.

    Gary.
  4. mac New Member

  5. jpe Member

    to create a user with a database

    phpmyadmin/priviledges

    add a new user.
    give the name and password
    set host to local

    in the next box down under Database for user select
    Create database with same name and grant all privileges

    hit GO and your done
  6. ou812 Guru

    I created a user using the method jpe provided and named it timeclock with a database using the same name I then did the import of create_tables.sql so now in phpmyadmin it shows timeclock(8)
    If I enter http://192.168.0.150/timeclock it shows
    The requested URL /timeclock was not found on this server.
    Apache/2.2.3 (CentOS) Server at 192.168.0.150 Port 80


    If I enter http://192.168.0.150/phptimeclock it shows
    Error: Could not connect to the database. Please try again later.
    it also changes to http://192.168.0.150/phptimeclock/timeclock.php


    Gary.
  7. euser4life Guru

    Gary, I'm guessing that you need to change the password you created for the "timeclock" database user in the context you copied into /etc/asterisk/extension_custom.conf

    Look for this line:

    Code:
    exten => s,n,MYSQL(Connect connid localhost timeclock timeclock timeclock)
    The second "timeclock" above should be the password you gave the database user you created (I'm assuming you created a user called "timeclock" as well). Also the last / third "timeclock" is the name of the database you created (assuming that you named it "timeclock" as well - If not change it in the line above

    (Connect connid localhost root passw0rd databaseName)

    If that is not it then browse to /var/www/html/phptimeclock

    Next open up the file labeled "config.inc.php" and look at line 40. Have you changed this to match the password you created for the timeclock database user? Are all of your variables correct?

    Code:
    $db_hostname = "localhost";
    $db_username = "timeclock";
    $db_password = "";
    $db_name = "phptimeclock";
    Also note the last variable "$db_name". You probably need to change it to "timeclock" instead of "phptimeclock". This must also match the name of the database you created. Let me know if this helps.

    P.S. Thanks to Ed and John for sharing this with the community!
  8. ou812 Guru

    Thanks euser4life

    That did the trick I changed user password to timeclock and edited config.inc.php for a database name of timeclock and I now can access the program and see how it all works.
    Thanks again.

    Gary.
  9. edisoninfo Guru

    It is entirely possible I mis-read the docs, but it was a bit of work to get this working. It took me awhile to realize I needed to copy the sounds into the /var/lib/astersisk/sounds folder for instance. Then it took me awhile of debugging to figure out why it always said it had clocked me "out" but never "in". Turns out if the info table is empty, it inserts the first record, but the inout field is null. Have not traced that down yet. When I manually modified that field to be "out", then things started working. I had three records in the info table for my test user, the initial "out" record I modified, then an "in" and "out" record added by the phone app. The initall "out" and the first "in" record had the same time on them 9:32pm. The second "out" record showed 9:40pm. Looked fine. But when I ran the report it showed I had worked 23 hours!! I deleted the initial "out" record manually and the report showed the correct time worked.

    As I said, maybe I mis-read the docs, limited as they are, but if I was not a mysql,php,linux programmer, I have no idea how I would have gotten it to work.

    That being said, I just LOVE this application. I have a couple of clients I can't wait to show it to. Thank you!!
  10. ou812 Guru

    thanks edisoninfo for the tip I have been trying to figure out why it would hangup on me when i dial 8000 it now plays the sounds. I have created new users but cant see were to give them a user id that they can use on the phone also anyone can log you in or out on the web portal it does not ask for the password ?

    Gary.

    Edit: username needs to be a numeric user id.
  11. edisoninfo Guru

    Correct. You have to use numeric ID's AND passwords. Problem is on most of the screens you only see the number, not the persons name. You have to remember who you are working on!

    As for asking for a password, that is the one piece of info in the doc, and it is easily missed. Login as admin and on the bottom left click edit system settings. Scroll down aways and change the "no" to a "yes" for the use passwords question.
  12. mac New Member

    Sorry, I am not good at writing instructions. I did have a problem with the clocking but we set it up to make the first time an in. So if there is no entry in the database for that user, clock them in. After that it checks the timestamp of their last action and then clocks the opposite.
    The password having to be numeric was somewhat annoying, but since the customer didn't want to use the web part except to make reports, I set it to show there. One day I might have a chance to rework the instructions.

    Ed
  13. ou812 Guru

    Suspicious Password Request

    Each time I click on this thread a box appears on the screen and says.
    A username and password are being requested by http://192.168.0.150. The site says: "Restricted Area"
    This looks very suspicious why would my pbx be requesting a user name & password from me when I click this thread I think it started after I installed this software
  14. tshif Guru

    Let me make sure I understand. When you click on THIS THREAD, your browser asks you to authenticate?

    That's just bizarre.
  15. ou812 Guru

    YES this thread, it did it tonight when I first came online and clicked this thread and it has done it a few times over the pass couple of days I press cancel when it comes up but now when I press to reply to this it did not come up, I may have to wait till tomorrow to see if it happens which will be the 4th or 5th time. very strange.

    Gary
  16. ou812 Guru

    This is a shot in the dark but why does forum thread show up on the access_log file in my pbx, the ip address is the desk top I was using to access the forum when i recived the password request.

    192.168.0.6 - - [27/Apr/2009:22:50:57 -0400] "GET /maint/phpMyAdmin/themes/original/img/b_usredit.png HTTP/1.1" 401 479 "http://pbxinaflash.com/forum/showthread.php?t=4136" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9"
    192.168.0.6 - - [28/Apr/2009:22:36:25 -0400] "GET /maint/phpMyAdmin/themes/original/img/b_usredit.png HTTP/1.1" 401 479 "http://pbxinaflash.com/forum/showthread.php?t=4136" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10"
    192.168.0.6 - - [28/Apr/2009:22:38:14 -0400] "GET /maint/phpMyAdmin/themes/original/img/b_usredit.png HTTP/1.1" 401 479 "http://pbxinaflash.com/forum/newreply.php?do=newreply&noquote=1&p=25837" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10"
    192.168.0.6 - - [28/Apr/2009:22:58:27 -0400] "GET /maint/phpMyAdmin/themes/original/img/b_usredit.png HTTP/1.1" 401 479 "http://pbxinaflash.com/forum/newreply.php?do=postreply&t=4136" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10"

    Gary.
  17. mac New Member

    Okay, I'm lost. I don't know what you have going on over there. Are you accessing this forum from your pbx somehow or is your pbx a different box?
  18. ou812 Guru

    My piaf is a dedicated server only used for the pbx (192.168.0.150).
    My desktop (192.168.0.6) is my every day computer which I use to access the internet,email,etc and this is the computer I use to access the forum which when I click on this thread I get a popup in the middle of the screen saying the pbx at 192.168.0.150 request my user name and password ?

    Gary.
  19. jpe Member

    Check everything you edited when you did the install. It is possible you pasted a link to this thread somewhere along the line. The how and why I cannot answer.
  20. lukicweb New Member

    time clock problems

    Hi, firs of all thanks for all instructions for time clock. I have I problem. I have managed to install phptimeclock and its working on trixbox. When I call 8000 it assk me to enter user id,when id that it asking for password as soon i enter password and # sign it disconnects. Hire is what a get on asterisk log

    -- Executing [8000@from-internal:1] NoOp("SIP/101-088d07e8", "Running miscapp 2: Timeclock") in new stack
    -- Executing [8000@from-internal:2] Goto("SIP/101-088d07e8", "timeclock|s|1") in new stack
    -- Goto (timeclock,s,1)
    -- Executing [s@timeclock:1] Answer("SIP/101-088d07e8", "") in new stack
    -- Executing [s@timeclock:2] Wait("SIP/101-088d07e8", "1") in new stack
    -- Executing [s@timeclock:3] Read("SIP/101-088d07e8", "user|tm_userid|||3|5") in new stack
    -- <SIP/101-088d07e8> Playing 'tm_userid' (language 'en')
    -- User entered '101'
    -- Executing [s@timeclock:4] NoOp("SIP/101-088d07e8", "101") in new stack
    -- Executing [s@timeclock:5] Wait("SIP/101-088d07e8", "2") in new stack
    -- Executing [s@timeclock:6] Read("SIP/101-088d07e8", "pass|tm_pass|||3|5") in new stack
    -- <SIP/101-088d07e8> Playing 'tm_pass' (language 'en')
    -- User entered '101'
    -- Executing [s@timeclock:7] NoOp("SIP/101-088d07e8", "101") in new stack
    == Spawn extension (timeclock, s, 8) exited non-zero on 'SIP/101-088d07e8'
    == Spawn extension (timeclock, h, 1) exited non-zero on 'SIP/101-088d07e8'

    Can some one please hel.

    Thanks in advance.
Thread Status:
Not open for further replies.

Share This Page