I am trying to build an online chat application on top of ejabberd, I am using extauth and everything was working fine till now. Now I am facing a problem in sending a message from A user who is not in B's roster (some sort of moderator or stuff), but ejabberd is blocking the message because both users are not connected, I have looked into shared roster feature of Ejabberd but it doesn't work with Extauth, I have also tried to filter packet (if packet is from moderator than simply forward it else do routine processing), but it wasn't successful (Don't know how to forward the packet and stop the execution of hooks).
Please help me how can I achieve this functionality.
Thanks
why not subscribe users to each other (by sending subscribe-subscribed sequence) - it may be temporary only. By subscribing users you will create entries in roster table, which will allow packet delivery. Also, depending on architecture of your chat app maybe try mod_muc?
good reference to all dataflows: http://xmpp.org/
Old forum though, adding the response to help and learn.
In order to bypass the hooks and forward the message , probably following steps might help
Add the hook for 'filter_packet' with more priority
In that do your validations
forward this by calling on 'run' on other hook which you are looking for
drop the package at that point( as other hook on which 'run' is called will take care)
Related
I have been following this page in the documentation to create a PayPal checkout integration for the purpose of allowing visitors to a site to make donations: https://developer.paypal.com/docs/checkout/integrate/#6-verify-the-transaction. It seems that the more simple donations buttons cannot be used, as it is a requirement that donations are saved to a database table.
I have so far implemented all of the integration up to some of part 6, which verifies the transaction on the server. The code provided on the page (I am using PHP) is not clear and all of the examples of server side validation that I can find refer to purchases, which do not apply to donations. However, even without this, in sandbox mode the integration appears to work. Would this also work in live mode without server validation (and there is no concern of a third-party editing "prices", as this is a donation, so why not let them pay whatever they like?)? If server validation is necessary, what resources are there that exaplain/demonstrate how to do server-side validation of transactions for simple payments (e.g. donations) that do not involve purchases?
Thank you for reading.
Per your own requirements, you want it to call your server after capture, so that it saves a record of the transaction in your server. Everything else is optional, and as you mention may not be needed for any purpose.
I am following this tutorial from androidhive. http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
Everything is working But The tutorial only shows how to send a push to ONE device at a time. I would like to send a push notification to all devices at once using the same method. I believe the way to do this is by editing the send_message.php But i'm still trying to understand how his method works.
I have tried commenting and emailing the person who wrote the article but have not gotten a response. I just need someone to point me in the right direction.
Any hints, guildance, answers, comments are much appreciated.
Now that you have successfully implemented what that tutorial teaches, the basis idea now for sending to multiple users will be something like this:
To send push notification to multiple users, you need to create an application server in PHP.Your application server will receive the registration id from the android application and will store it in a database (may be mysql).
Now when you want to send the message to the application then you write a message and fetch all the registration ids from the database which was stored earlier.
You can follow this useful tutorial to achieve exactly what you want.
The tutorial which you have mentioned was made using GCMRegistrar which is deprecated now.Instead you need to use GoogleCloudMessaging API.The link which i provided uses the new way.Hope this helps you to implement what you want.
I have a website where people will book for Site visits.The Support Executive Confirms Site visit in the previous day. Once the Site visit is confirmed on the day on which site visit should happen the customer should receive SMS in morning telling that you have site visit today as requested.
I have Third party SMS Service
Now I Should Run a Code in PHP, MySQL which sends a SMS in the morning on which the site visit should happen
How can I Do that
Cron -> starts PHP-Script , PHP Script reads records from the SQL Table and checks if an SMS has to be sent, i assume its sms over mail, so you can use the integrated php function to send out mails to the sms gateway. For the guy confirming the visits, create another site with proper authentication where he can access the table and agree with the site-visits and anotherone for the customer to register for site visits
You need a cron job set to run in morning which will call your php file have code for looking in database for customers you need to send sms to.
Yo need to register to sum sms gateway provide 2 good one i know is clickatell and eztexting.
You can get there api for sending sms in there website.
Happy Smsing :D
Set a Cron Jobs in your Control panel.Try this link
http://www.devx.com/DevX/Article/39900/1954
If you would like to try an entirely different approach, check out:
Sent.ly - http://sent.ly
I am the founder of Sent.ly and thought maybe Sent.ly could help you out...
Sent.ly allows you to use an Android phone as an SMS gateway. So... you could just purchase a cheap Android phone ($150 or so) and set up Sent.ly on it and put a SIM in the phone.
By calling the Sent.ly API, the SMS would go out through the SIM in your Android phone. Sent.ly also has the option for scheduling an SMS for sending later which is your use case.
This also allows your PHP application to RECEIVE SMS in addition to just sending it out.
You can setup rules and if an incoming message matches a rule, it would be posted to a PHP page of your choice.
Since I am a great fan of stackoverflow, I would like to invite you to try Sent.ly. We would be happy to set you up with extra credits if you like. Just mail us at support#sent.ly
Cheers,
Varun
I have developed a system like this for use with some of my clients, and you can easily use it to integrate with your website or applications, through HTTP POST or WebServices (using PHP, C# or whatever).
If you are interested just leave an email or other contact information as a reply to this answer and I will gladly send you a sample code of how to send SMS, setting the desired time for sending messages, beyond other things, through our system.
You will not need to have any kind of cron knowledge and setup, it is all handled by our system, and the code is pretty simple and straight forward. You will only need to call our services upon site visit confirmation, setting the desired message sending time, and our system will do the rest.
Best regards.
I'm coding a team collaboration web app in PHP, and I have a few events that users get notified about through email and/or SMS. The current way I'm doing it is as follows:
Every user has his notification settings in the database as boolean variables.
Say users would be notified when someone comments on the team's page. When the function that posts a comment is called, the same function would contain extra code that checks "who wants to be notified about this?" and then sends notifications to them (which slows down the function a bit).
Is there a more efficient/faster/flexible way to setup notifications? maybe through a script that runs via a cron job? or shall I just keep doing it this way?
I appreciate your help.
I implemented a similar method to the one you're following on a website with a multi-table approach. The users table held the contact information along with opt-in, opt-out options while an event table held the instructions to notify. Several other events were hard coded because of their importance. The thing that set the site apart a bit was a "workflow" area on the user's dashboard that also showed the user what action items they had. We found that most users ignored the emails and dealt directly with that dashboard workflow area. You'd be surprised how many times people change emails or just ignore them altogether.
With 280,000 users and daily visits in the tens of thousands, there was no performance issue noticed. However, the process of queuing emails can be inefficient if you're not careful, so take particular time to benchmark your mail sending functions--its as easy as echoing out microtime before and after the mail send is accomplished--to evaluate its effectiveness. On my current company's site, such improvements yielded a 800% reduction of email queuing time (queuing being the process of generating the emails and submitting them via php mailer to the mail system for distribution)
I'd say have a table that is a queue of notifications. Let the function that post a comment still check "who wants to be notified about this?" but then just log entries containing the messages in this table. Then have a separate process work from the queue i.e. your cron job suggestion.
Depending on your database you may perhaps make use of database events or triggers instead of a cron job. This however have the requirement that your database allow you to put code in your database that will send the SMS or Email. This poses a security risk normally which you may or may not be concerned about in your setup.
I am trying to create a website that users have to register for, and this gives them access to all the site features. Potentially, maybe i want users to pay a yearly subscription fee.
Is there a library to handle this for me? This should include, keeping track of user cookie and logged in status, keeping track of expiry date, verifying email addresses, banned users... etc.
I mainly use PHP and MySQL but am open to using something else if there is this really good library out there.
Thanks.
The Zend library can give you a lot of those chunks of code with a little setup. That would be my best recommendation but if you want something that is a little more setup from the get go I would recommend using a Drupal install to accomplish most of this functionality.
Drupal has many modules that can be setup and configured to handle most of this. Including the subscriptions, though you will need to setup a payment gateway in order to process them. I know Authorize.net offers a subscription service, but my bet is the setup will work with Paypal or Google Checkout as well.
Hope that helps give you some direction to solve your problem. :)