-
Posts
284 -
Joined
-
Last visited
Posts posted by gutterboy
-
-
Ok, found this: http://www.blesta.com/forums/index.php?/topic/1021-staff-password-reset/
All good now after getting the link from the log_emails table.
-
That's one of the reasons, the other is to hinder the use of rainbow tables. Even if each user has the same salt and therefore the same hash, the salt would prevent them from using any previously existing rainbow tables. They could generate a rainbow table for that particular salt though, which is why having a separate salt per user is better as each user would need their own rainbow table (e.g. plain old brute force)
Well yeah......... pretty useless if users all had the same salt haha...... as then they would have the same hash anyway.
-
Well isn't the point of salts to avoid having users with the same password getting the same hash?
-
You could try copying the password from another user in the database
Doesn't it use a salt?
-
Is there any manual way I can do it? I really need to get in there lol
-
Yes, all other mails work fine. I get invoices no problems.
-
Interesting - I think this may have something to do with the license. I just tried it on my "owned" license and it worked, but it will not work on my "dev" license.
How do I reset my password on a dev license installation?
-
I have lost my password for my admin account and I used the reset password form but I am not getting any emails. I even tried changing my email in the database to something different and I didn't get anything.
-
Ok thanks for that.
-
with upgrade function , you shoukd register the new event and delete the old event .
look at support manager plugin to insipre the how the upgrade work .
Ok thanks!
-
I'm just wondering when the "Transactions.add" event is triggered, I am currently doing something like this:
public function getEvents() { return array( array( 'event' => "Transactions.add", 'callback' => array("this", "notify") ), array( 'event' => "Transactions.edit", 'callback' => array("this", "notify_edit") ) ); } public function notify($event) { // Get params $params = $event->getParams(); // Set transaction id $transaction_id = $params['transaction_id']; if (!isset($this->Transactions)) { Loader::loadModels($this, array("Transactions")); } // Now get transaction details $transaction_details = $this->Transactions->get($transaction_id); ......... }
Now, I'm wondering if there is anyway at all for me to get their amount due at the time they made this transaction (meaning their debits not including their current credits)?
I know of the amountDue method which can be used via the API, but obviously if I run this it will get the amount due AFTER their payment from this transaction has been applied correct? ..... also, does their amount due only go down once a payment has been APPLIED?
Last question....... are there any events that get triggered when a payment is APPLIED to an account? So that you don't get notifications for loose credits until they are actually applied?
Thanks!
-
or you should make the change in your upgrade function and upgrade the plugin from plugins tab .
I'm not sure how that would work? Isn't that more for database changes etc?
-
Ok, figured the problem out.
If you make any changes to the plugin AFTER you install it, you need to first UNINSTALL it and then INSTALL it again.
-
Looks like you're correct, the string "this" is supposed to automatically trigger an object instance from that class.
Are you sure your callback is not being called? How are you evaluating whether the method was called? They will only be called if a transaction was successfully added or edited.
So I don't need to register it first?
Yes I'm sure they aren't being triggered. What I'm doing is I'm recording a payment for a client via admin which adds it to the transactions - if I call the method "run" then it will trigger it (which I can tell as it updates the output.txt file; if I change the name of the method and run that scenario again, the file isn't updated. Same goes for editing a transaction via admin - no creation of output_edit.txt.
-
It was this one: http://docs.blesta.com/display/dev/Plugin+Events
But I just had a look at: http://docs.blesta.com/display/dev/Creating+Events and it seems more clear now. So basically I will need to register the callbacks to that event so they get triggered?
As for specifying the class, I thought that what was the "this" referred to, so it was a reference to "$this".
-
Your events define a callback array with the string "this". I assume you're using this to register events, in which case the first index should be a reference to the object whose method (second index) is to be called.
e.g.
array( 'event' => "Transactions.edit", 'callback' => array($this, "notify_edit") )
Well from what I understood from the docs was that by doing something like what I am doing it should use the callback of $this->notify or $this->notify_edit as it works when I name the method "run" as that is $this->run no?
-
I am having problems with triggering the method unless I name the method name run.
For example I have this code:
public function getEvents() { return array( array( 'event' => "Transactions.add", 'callback' => array("this", "notify") ), array( 'event' => "Transactions.edit", 'callback' => array("this", "notify_edit") ) ); } public function notify($event) { // Get params $params = $event->getParams(); // Set transaction id $transaction_id = $params['transaction_id']; if (!isset($this->Transactions)) { Loader::loadModels($this, array("Transactions")); } // Now get transaction details $transaction_details = $this->Transactions->get($transaction_id); file_put_contents(dirname(__FILE__) . '/output.txt', print_r($transaction_details, true)); } public function notify_edit($event) { // Get params $params = $event->getParams(); // Set transaction id $transaction_id = $params['transaction_id']; if (!isset($this->Transactions)) { Loader::loadModels($this, array("Transactions")); } // Now get transaction details $transaction_details = $this->Transactions->get($transaction_id); file_put_contents(dirname(__FILE__) . '/output_edit.txt', print_r($transaction_details, true)); }
This will not trigger the notify method at all; however if i change the method name to run it will trigger it.
Another problem is I cannot get the Transactions.edit method to run. I even changed the name of the method to run but it never would trigger.
Help!
-
Great - thanks!
-
When a transaction is added with a status of "pending" I assume that triggers the Transactions.add event, but I'm wondering, if and when that transaction changes to "Approved" will that then trigger the Transactions.edit event?
-
Thanks to you both.
-
That worked but I had to change:
$this->Transactions->getByTransactionId($transaction_id);
to..
$this->Transactions->get($transaction_id);
-
The EventObject vars that store the info are protected so that might be var_dump() doesn't output them.
Yes, if you look at where the transaction event is registered and triggered you can see it is the transaction id (seems there is actually a transaction.transaction_id and transaction.id, this is the former.
$this->Events->register("Transactions.add", array("EventsTransactionsCallback", "add")); $this->Events->trigger(new EventObject("Transactions.add", compact("transaction_id")));
$this->Events->register("Transactions.edit", array("EventsTransactionsCallback", "edit")); $this->Events->trigger(new EventObject("Transactions.edit", compact("transaction_id")));
You can get the actual transaction like this
if (!isset($this->Transactions)) Loader::loadModels($this, array("Transactions")); $this->Transactions->getByTransactionId($transaction_id);
Awesome - thank you!
-
If you look at the EventObject class, you should be able to call the following methods.
$event->getName(); $event->getParams(); $event->getReturnVal();
A useful thing to note is that you can use
print_r($event, true);
and it will return the data instead of printing it.
Hmmmmmm....... why doesn't the var_dump() output the object data then?
Anyway....... I tried those and it didn't give me much information; $event->getParams() just returned an ID, which I assume is the id of the transaction?
-
I'm trying to create something so that when a transaction is created I trigger another function, which is working, but I'm having trouble understanding how to get the event details of the transaction.
For example, in my plugin handler file I have this:
public function getEvents() { return array( array( 'event' => "Transactions.add", 'callback' => array("this", "run") ) ); } public function run($event) { ob_start(); var_dump($event); $content = ob_end_clean(); file_put_contents(dirname(__FILE__) . '/output.txt', $content); }
All I get in the contents of output.txt is:
1
How can I get the event details such as how much they paid etc?
Not Getting Lost Password Email For Admin Account
in Support
Posted
Ok, seems the issue was because the from address wasn't a real email address; once I changed it to a real email address it worked fine.