GO HERE timeclock application

Status
Not open for further replies.

mac

Member
Joined
Dec 19, 2007
Messages
72
Reaction score
1
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
 

Attachments

  • php timeclock install.zip
    40.4 KB · Views: 252

gaijin

Guru
Joined
Nov 16, 2007
Messages
170
Reaction score
0
WOW!

I've been looking for something like this!

I will install tonight and see how it goes!
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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 if someone could point me in the right direction it would be help full.

Gary.
 

jpe

Member
Joined
Nov 14, 2007
Messages
149
Reaction score
0
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
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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.
 

euser4life

Guru
Joined
Dec 18, 2007
Messages
223
Reaction score
0
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!
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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.
 

edisoninfo

Guru
Joined
Nov 19, 2007
Messages
505
Reaction score
4
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!!
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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.
 

edisoninfo

Guru
Joined
Nov 19, 2007
Messages
505
Reaction score
4
Edit: username needs to be a numeric user id.

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.
 

mac

Member
Joined
Dec 19, 2007
Messages
72
Reaction score
1
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
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
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

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

That's just bizarre.
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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/community/threads/timeclock-application.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/community/threads/timeclock-application.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/community/threads/timeclock-application.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:58:27 -0400] "GET /maint/phpMyAdmin/themes/original/img/b_usredit.png HTTP/1.1" 401 479 "http://pbxinaflash.com/community/threads/timeclock-application.4136" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10"

Gary.
 
Last edited by a moderator:

mac

Member
Joined
Dec 19, 2007
Messages
72
Reaction score
1
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?
 

ou812

Guru
Joined
Oct 18, 2007
Messages
479
Reaction score
79
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.
 

jpe

Member
Joined
Nov 14, 2007
Messages
149
Reaction score
0
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.
 

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
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.
 
Status
Not open for further replies.

Members online

Forum statistics

Threads
25,782
Messages
167,511
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top