-
Posts
705 -
Joined
-
Last visited
-
Days Won
2
Everything posted by alexm
-
@kongondo ?? keep well, cheers for the update
-
Just a note on this as I'm just playing around with this. For me, adding to admin.php in site/templates/admin.php doesn't work, however ready.php does as expected.
-
?? let's wait and see what he says. If it's going to be a while before it's released, we'll get it sorted!
-
-
@Spinbox if @kongondo isn't going to have a release for that feature soon, I'll finish working on the module I was creating ASAP and share it. I was/am 80% there with it, but got sidetracked with a large project. But happy to set dive back in and get on it. I'll await his response though before I spend time needlessly ?
-
Not that I can recommend. I’d just be doing a google search and suggesting tools that I’ve not used to be straight up honest. Sorry!
-
I’ll be intrigued to see what someone more knowledgable than myself finds if and when. The only other thing I can think of is if you have a page that accepts url parameters, say for Ajax requests or something such and those values that get processed aren’t sanitised. But that’s all I’ve got.
-
What @wbmnfktr said
-
Interesting! And you’re certain it’s not your hosting that has in fact been compromised? Be it your login details to access cPanel or similar, or if you are on shared hosting that they’ve not managed to exploit a vulnerability on that side of things? You could ask your hosting provider if there is anything interesting in your access logs etc. Do you have forms on your website and if so, are they sanitising the data? Is there any old modules or JavaScript libraries? Is ProcessWire up to date? I’m no security expert, but these would the key areas I would be asking questions about that come to mind right off the bat.
-
I'm in a bit of a fork in the road with a foot in both camps with a situation for something I'm working on. I have an instance where I require perhaps one, or in some cases many different types of data to be store on a page which I would suit ProFields Table. Now... I started by using tables as this keeps fields to a minimum and also is ideal for the purpose, however, there might be an instance where on one page there may be 20 different types of items which more or less follow the same data structure. So with this logic, I then have to create a table field for each type of item so I can split them out and keep records of them easily. Now, the various item types could be in the hundreds+. So then the unique field for each type route becomes bad for scalability and performance. This is where I skipped the idea of using PageTable and having one ProFields Table field that handles all types, as I would still have to create a template for each item type if I want to clearly consolidate and store the different types separately on one page. So then I settled logically on using RepeaterMatrix as I can create the various types and use the same Table field for the various type but have lovely separation on one page for the various types of items that should be grouped together. To the best of my knowledge, this would be the best way in terms of keeping things maintainable and also would scale better in general. Even though I have to descend another level to grab the data when I need it, there are means and ways to optimise this, such as joining the data I need in queries or even having fields on the parent page that are updated/recalculated (at intervals via cron or when one of the items table row's data changes). This would likely be much faster for calculations and saving lots of selectors?? Now.... Herein lies the question. Is there any impact (putting aside having a super long list of item types to manage and look at) performance wise to having LOADS of item types as ReaperMatrix item types so I maintain the separation? This leads me to my last thought process, whereby I have one table field and add another column that is called category or type as the first column for instance and this stores the various item types. Then I end up with one field (though it won't be as some data structures are different enough that I think it wouldn't make sense to add loads of columns for those lesser common cases, as I'm just storing loads of empty columns then potentially) and potentially a couple of others for the edge cases where the data warrants a different Table field with the extra columns required. The thing I don't like about this though is that it offers less separation for easily querying just what you want as you have to iterate over potentially a very long table and get a certain type every time you need to get that data from various pages based on type and also it will have loads of different types recorded within it. Also it's worth mentioning that there may be thousands of child pages of a parent. The child pages being the page that will store the data for the various item types, which is why I want to try and find the happy medium between the most performant route vs the most structured, but with a strong inclination to lean towards it needing to be the best route for scalability performance wise. Your thoughts are greatly appreciated! Edit: I should add that I’ve read this thread: but although it appears to ask the same question, there is the intrinsic difference with the number of types of data being the key focus for me. Cheerrrrrs all!
-
Not sure if this is still a thing that people require, or this should really be posted here for security reasons, (if so, feel free to remove) but here's a solution that is tested and works. It relies on both instances using the same user salt. $usersArray = []; foreach($users as $user) { if($user->isSuperuser() || $user->name == 'guest') continue; // Skip the admin and guest user $roles = []; foreach ($user->roles as $role) { $roles[] = $role->name; } $usersArray[] = [ 'username' => $user->name, 'email' => $user->email, 'roles' => $roles, 'pass_hash' => $user->pass->hash, 'pass_salt' => $user->pass->salt, ]; } $usersJson = json_encode($usersArray); echo $usersJson; Then copy the output JSON array and then drop it in $json variable in the next part on the other end. $json = ''; $importUsers = json_decode($json, true); foreach ($importUsers as $iUser) { $userExists = $users->get("name={$iUser['username']},email={$iUser['email']}"); if ($userExists->id == 0) { echo "{$iUser['username']} should be added<br>"; $u = new User(); $u->name = $iUser['username']; $u->email = $iUser['email']; if (count($iUser['roles'])) { foreach ($iUser['roles'] as $role) { $u->addRole($role); } } $u->pass->hash = $iUser['pass_hash']; $u->pass->salt = $iUser['pass_salt']; $u->save(); echo "User: $u->name added successfully<br><br>"; } } Obvs add any other field data you want to export and import.
-
Long and short of this is thank you @kongondo for helping me to rectify the issue with my custom addon (which I will happily share) once done. It was due to me not correctly setting up the necessary methods and properties before installation, so one I knew that my custom addon's main class file was correct, per @kongondo's advice, I simply de-activated and re-activated the module and I am able to access the addone page and fieldname as expected. Big thank you as always dude!
-
Should order confirmation emails also be received by store?
alexm replied to alexm's topic in Padloper Support
@kongondo I did indeed. The first couple definitely ended up in the ether!! ??? -
@kongondo Hmmm, one still doth not follow. I'll private message with further deets I think. There is no rush or obligation to help if you are busy (which I know you are), but I think you'll see what I'm going for ?
-
Good evening @kongondo, just a quick one (hopefully). Sorry in advance, I'm not much cop with module development etc. I'm just wondering how I access the addon page and 'padloper_settings' field name from the TestAddon class. I note the setAddonPage() method in the custom addon docs but not sure/understanding entirely it's purpose or if this is used to retrieve them? But effectively I've created a method saveConfigurations() which gets passed the fields array and JSON encoded ready to save to the 'padloper_settings' field. Now I just need to figure accessing the page object and field name in the right manner rather than hard coding. Thank you in advance for any assistance as always.
-
Should order confirmation emails also be received by store?
alexm replied to alexm's topic in Padloper Support
Ok weirdest vibe!! I've just received 2 emails for orders (2 new live orders) with the above code and no changes. One being a stripe payment and one being a paypal payment. I wonder whether that narrows it down to me using Invoice payment as the option. Either way, it's working as expected. How very very bizarre!! -
Should order confirmation emails also be received by store?
alexm replied to alexm's topic in Padloper Support
Haha, yeah, poor form on my part for not being at all descriptive. Sorry! ✅ The hook is called for sure I'm uncertain as to the rest. If I do a bar dump on $sent = $mail->send(); I get 1 as the response. I don't know whether this would be the expected response mind and there is definitely no email being received. So somewhere around this point there seems to be a potential issue. I'm receiving emails from the email address being set as the from address in other parts of the code which utilises wireMail(), which is why I thought perhaps my hook's function wasn't quite set up right. Though it seems like it should be to me... -
Correctamundo. This resolves this matter thank you sir
-
Got it! Needs to be public property public $renderViewURL = 'view-name';
-
Hmm when I add a bar dump in PadloperProcessRenderAddons.php before the if statement on line 460 it says that the renderViewURL property is null. Got any pointers for me haha. Sorry.
-
Morning @kongondo, but ignoring me setting the renderViewURL property to 'go-cardless', say I want to make, for the sake of argument, a discount code addon - what would I set the returned value of getType() to? 'custom' doesn't work for me and if I set it to that, nothing shows in the addons table Happy Sunday mate
-
/** * Returns addon type. * * Must be one of Padloper pre-defined types. * * @return string */ public function getType() { return 'custom'; } If I return 'payment' it shows in the addons table, but I was following the docs which says to return 'custom'
-
Can someone tell me where I'm going wrong. I'm a little lost with the MyAwesomeAddon documentation. <?php namespace ProcessWire; class TestAddon extends WireData implements PadloperAddons { /** * @var string */ protected $renderViewURL; public function __construct() { $this->renderViewURL = 'go-cardless'; } /** * Returns addon type. * * Must be one of Padloper pre-defined types. * * @return string */ public function getType() { return 'custom'; } /** * Returns addon class name. * * @return string */ public function getClassName() { return "TestAddon"; } /** * Returns user-friendly title of this addon. * * @return string */ public function getTitle() { return "TestAddon Title"; } /** * Returns short description of this addon. * * @return string */ public function getDescription() { return "TestAddon description here."; } }
-
Should order confirmation emails also be received by store?
alexm replied to alexm's topic in Padloper Support
Yo @kongondo How far off is the following code as an interim solution for mine and @Spinbox's requirements? It doesn't seem to be working and I can't see what I'm missing. (I've changed the actual domain to 'domain.com' and admin page name to '/processwire/' for posting here) $this->addHookAfter('PadloperProcessOrder::sendConfirmation', null, 'sendOrderConfirmationToAdmin'); function sendOrderConfirmationToAdmin(HookEvent $event) { $object = $event->object; $orderPage = $event->arguments(0); if (is_null($orderPage)) { $orderPage = $object->getOrderPage(); } if (empty($orderPage->id)) return; $orderId = $orderPage->id; // Drop this in place of $loginLink to send the request straight to the print order link // $printInvoiceUrl = "https://www.domain.com/processwire/shop/orders/print-invoice/?id=$orderId"; $loginLink = "https://www.domain.com/processwire/shop/orders/view/?id=$orderId"; $shopEmail = wire('padloper')->getShopEmail(); $mail = wireMail(); $mail->to("email@domain.com"); $mail->from('no-reply@online.domain.com'); $mailSubject = sprintf(__("New Order - #%s"), $orderId); $mail->subject($mailSubject); $mail->body("There's been a new order #$orderId!"); $mail->bodyHTML("<p>There's been a new order #$orderId!</p><p><a href='$loginLink'>Click to login and view</a></p>"); $mail->send(); } -
Feature Request - Add bank account details under General Settings
alexm replied to alexm's topic in Padloper Support
NICE! I thought we might have crossed our wires!! ? I think that would be all that is required for bank details as far as I am aware for sure Cheers!