Jump to content

gizmola

Administrators
  • Posts

    5,539
  • Joined

  • Last visited

  • Days Won

    108

Everything posted by gizmola

  1. Do you realize that the SSL configuration for radproducts.com is incorrect/broken?
  2. Is that your actual html page? Where is your doctype? Like Requinix stated, the 1st thing you should be doing is using your browser development tools to investigate. In particular the javascript console, network tab, and perhaps the sources, in order to debug your javascript if some obvious problem doesn't jump out at you before you get to that point. Since you rely on ajax, the network tab is where you can actually debug the data loading.
  3. No worries. To answer your question, typically apache's main config file will load files in one or two other directories. Some linux distros have schemes for turning vhosts on/off via symlinks from one directory to another. It really depends on your OS/Linux distro and the defaults. Reading through the conf files is worth doing. The general best practice is to put each vhost in its own conf file. You also want to have each virtual host site in its own directory, and not have any nesting. In other words Do this: /var/www/site1 /var/www/site2 Don't do this: /var/www/site1 /var/www/site1/site2 Really, the best practice for php projects is to do this: /var/www/site1/public <- set webroot to this for site1. /var/www/site2/public <- webroot for site2 This allows you to have other directories with php files in them that you want to include, but can't be directly accessed via a url. Things like config files, class definitions, function libraries etc. can all be kept out of webspace, but are still available by scripts in or beneath site1/public.
  4. If you step back from the minutae for a second and look at what your code is doing: if ('delete' === $table->current_action()) { $message = '<p>' . sprintf(__('Notifications deleted: %d', 'prg_customer_notification'), count($_REQUEST['id'])) . '</p>'; } This has an implicit assumption built into it: so long as the current_action() result is the string 'delete' then you assume that there was notifications deleted. What if there were no notifications deleted, or the list to be deleted was empty? So how could you fairly easily fix this issue, where you need to be sure that there is a reason to display this message, while also providing additional feedback to the UI? if ('delete' === $table->current_action()) { if (!empty($_REQUEST['id']) && is_array($_REQUEST['id'])) { $message = '<p>' . sprintf(__('Notifications deleted: %d', 'prg_customer_notification'), count($_REQUEST['id'])) . '</p>'; } else { $message = '<p>Nothing to delete.</p>'; } }
  5. The servername needs to be a domain name -- something that the DNS of your workstation can resolve. What you want to do is use an appropriate top level domain (ie. .com, .net etc) for testing, and set that up in your hosts file on your workstation. The IETF set aside a number of development tld's, and of these you should use either .test or .example. You should avoid using .localhost even though that is also reserved, just in case you get some loopback conflict. so what I'd suggest is that you add something like this in your /etc/hosts 127.0.0.1 www.project1.test 127.0.0.1 www.project2.test It doesn't matter what project1 or project2 actually is. One argument in favor of using one domain like (projects.test), is that you can setup a local SSL cert on your machine, and use that for multiple projects. You would then use www.projects.test, cms.projects.test, admin.projects.test or whatever else makes sense for your development work. It doesn't matter how you do it, so long as it works for you. In this example, I will stay with the 2 separate domains example. Here is the apache vhosts config you would want: <Directory /> AllowOverride None </Directory> <VirtualHost *:80> ServerAdmin webmaster@test ServerName www.project1.test DocumentRoot /var/www/public_html <Directory /var/www/public_html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog /var/log/apache2/project1-error.log LogLevel error CustomLog /var/log/apache2/project1-access.log combined </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@test ServerName www.project2.test DocumentRoot /var/www/test/public_html <Directory /var/www/test/public_html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog /var/log/apache2/project2-error.log LogLevel error CustomLog /var/log/apache2/project2-access.log combined </VirtualHost> Notice that I fixed the Directory statements for each of your vhosts. These refer to the directory structure of your server, so you can't redefine those perms, as they aren't relative to a specific vhost. Apache starts out with (or should, depending on your OS/Distribution) a definition of <Directory />AllowOverride None</Directory> as a way of blacklisting the entire directory structure by default. You are then meant to override specific directories from which you are actually serving content. Usually this type of configuration is set so that you can/will have a .htaccess file in the root of your project directory that you will use for things like mod_rewrite rules.
  6. If you joined the discord and had an issue getting access to the channels, PM me here, or any of Zane, requinix or myself in Discord and we can get your status fixed.
  7. Well these are a series of functions. Do you have a function that checks for the AD security group membership? You should build one around the PHP LDAP functions. I don't know if you already know this, or you are asking how to query AD, you need to use the LDAP library. Since there is a variety of different ways to set up groups in AD, you'll have to figure out what is appropriate for your system. I haven't done this in a very long time, but it's good to use an LDAP query tool to figure out what queries return what you expect. This Stackoverflow question is old, but it should give you an idea of how to attack the problem: https://stackoverflow.com/questions/23270575/validate-ad-group-membership-with-php-and-ldap Assuming you had such a function, simply adding an additional check should do the trick. I would rewrite this function in this way for clarity and efficiency: function check_australian_access($hide) { global $user_details; require_once '/var/www/common/emailer.php'; if (!$hide || (is_australian_server() && is_ad_member('ALLOWED'))) { return; } // Shouldn't be able to see this print "<b>This information is restricted to users of COMPANY, located within the Australian network.<br> <br> This access attempt has been logged.</b> <br><br> IP Address: $_SERVER[REMOTE_ADDR]<br> Username: $user_details->username"; email_from_to('SYETEM <fromaddress@company.com>', 'toaddress1@company.com,toaddress2@company.com', "Illegal Access Attempt - $_SERVER[REMOTE_ADDR] - $user_details->username", "An unauthorized user has attempted to access restricted information.\n\nURL: $_SERVER[REQUEST_URI]\n\n" . print_r($_SESSION, true) . "\n\n$_SERVER[HTTP_USER_AGENT]"); exit(); }
  8. There is some variation in regards to the palette extraction. I used the picture from your mockup. There is very little difference between the one you have and the one I added. The order of the colors is not important either. If you like the mocks I posted, use the colors I posted, or use the ones you posted. You're going to get similar results with either palette. My inclination is that I would use the brown for the background, the muddy green for the menu and bottom bar, and the tan for panels. With tan for panels, you can use the brown for your text inside the panels as in the mocks, and you can also the darker green for another panel type if you want variety.
  9. It's a class that can be iterated with foreach. It is not an array, but it has many eloquent specific capabilities you can read about here: https://laravel.com/docs/9.x/eloquent-collections. For example it has a method that will return all the primary key values of all the models in the collection. Keep in mind that it extends the Laravel collection base class, which has many more methods that might be useful depending on what you want to do. See https://laravel.com/docs/9.x/collections
  10. Seems like you ought to buy Barand a cup of coffee at least
  11. Yes definite improvement. Don't use any colors that aren't in your palette other than black or white, which are neutral and sometimes necessary for legibility and accessibility. The ugly yellow color that seems to persist in the menus needs to go. You have the option of making the top menu black with white or off-white lettering, or going with a color combo from your palette. I'd also suggest taking a look at fontawesome and trying to find some icons that you can use to accent your sections. The mockup has examples that should give you some ideas. You want to find an icon for each section that visually illustrates what the section text is saying. I extracted a palette from your image and applied it to colormind.io, which has a nice prototype screen showing you different ways the palette could be assembled. My advice would be to use some of the darker or lighter shades of the palette, and then use the green for your windows. The mockup here should help you get a better idea of what you like. The top is the color palette. You then have a summary, that also works to show you what a light overall background color for your site would look like. The next section is what a dark color background would look like. I would suggest you start with that. I also provided the "Dark on light" mockup. I'd suggest trying the "main brand color" #8c8f38 color for your menu and footer background.
  12. What you are doing is very confusing. Why are you not extending from the \PDF_Code128 class? Do you need the features of that class or not? Having code that both defines a class and also creates objects of that class is terrible. Have your class definition in a script with the name of the class as the name of the script. Then require that class in your script. As for the problem, it's shown to you clearly in the stack trace. You need to actually learn to look at it and follow it. FPDF is throwing the "No page has been added yet". You need to determine where in your code, that exception is occurring. The stack trace shows you that: $barcode = $pdf->Code128( 4,3,$data['item_code'],30,10); So this is the code that triggered your error -- and it's an object you try and create, purely so you can pass it into your class, yet don't even use in your code.
  13. The plugin issue is just a theory. I have no experience with XenForo, so all I can offer is an educated guess. If the person had some sort of axe to grind with the forum, then I guess that could be the case, but I thought that you moved things to a new server, so perhaps there is a separate installation for plugins that needed to be done.
  14. I don't know if you have additional configuration you aren't showing us, but the mail server has to be configured to relay mail from your server. Outside of that, there are so many different things that could be causing the send to fail. Are you getting an Email failed message? As requinix stated, there is little to no visibility into SMTP using the mail() function in the way you are trying to use it. Phpmailer or Symfony mailer have ways to actually debug the internals of the SMTP process.
  15. This is moving in the right direction. Use a CSS reset. If you're not sure about how to approach that, while it might be a bit of an overkill for your project, normalize.css has been adopted by major css framework projects like bootstrap, so it will accomplish what you want. https://necolas.github.io/normalize.css/ In regards to your color palette, I think you need to either lean fully into the "warning sign" yellow on black of the menu and footer, or use something that goes with the light blue background of the panels. The colors do not go together at all. I'd suggest a color reboot. There are a couple ways you can go. First you can try out one of the numerous color palette generators to find a set of colors that are harmonious and utilize various color theory algorithms to generate the palette. One I like is Paletton: https://paletton.com/ It shows you a color wheel where you can choose from monochromatic, adjacent, triad and other schemes, and with a click or 2 include or exclude things like "complementary colors". There are also sites like css drive where you can start with an image, and let their software analyze the image to extract a palette for you. Here's one example, but there are others that might be as good or better: http://www.cssdrive.com/imagepalette/ I would also advocate making sure that you don't have odd alignment issues like you now do with the fox image. That should fill the entire panel, or at least be in the middle of the panel. There's really no reason not to have it fill the entire panel as you now have it. There's also that weird vertical line between the panels, that should go away, along with other things. If you make use of css variables, then you can recode your css so that it's easy to change the core colors you are using, which will allow you to try out a few different palettes quickly to see what ultimately looks the best to you.
  16. People will need to see the structure of $resp in order to help you. Also, please use the code button <> to paste your code into your posts.
  17. The site just has a dated feel to it, that could use a good freshening. The real sign of professional design starts with consistency and each of your pages has something that's a little bit different, which undermines the consistency. While I like the fox picture, I would make that more of a hero image or something at the top of the page, that then combines the other pages via scroll. A visitor shouldn't have to investigate your menus in order to find out what the product actually is, or why you should care about it. The buttons on the download page look like something you would find on an early 90's ebay page. The first thing you should do is replace those with some decent markup, css and button code that has hover effects.
  18. There seems to be a problem for some number of people, typically having to do with local OS/Network/DNS/IPv6 settings. You can see if any of the suggestions here are helpful to you: https://github.com/composer/composer/issues/9376 You can run composer diagnose to have composer go through a battery of tests that might help you see where your issue is.
  19. Nice job foxclone. A few notes: My main suggestion for you is to replace your use of var with the appropriate let and const keywords, as that is the current (ES6) way to declare variables. People don't use var anymore for reasons you can explore more fully yourself. If a variable is a base javascript type that is not an object, and that value won't change, then use const. Also use const if it is an object (in most cases). Otherwise use let. One other thing that is a good practice to get into, is to not use ';' as javascript doesn't require a semi-colon to end a statement. Trying to avoid using semi-colons will make your javascript more concise and help remind you of the syntactical differences between php and js, when you are switching back and forth between them. When you consider your code, the check for timeleft <= 0 will be true when your counter is == to 0, so there is no reason to have a separate condition check for that. Do both things you need to do (clearInterval, update your paragraph to 'done') within that same condition Here's a refactor for you, implementing all the comments above--- let timeleft = 10 const downloadTimer = setInterval(function() { timeleft-- document.getElementById("countdowntimer").textContent = timeleft if (timeleft <= 0) { clearInterval(downloadTimer) document.getElementById("test").textContent = "Update Complete" } }, 1000) downloadTimer()
  20. There are a few concepts that will help you. The first is the use of the empty function. For arrays it is especially useful, in that it checks both for existence and whether or not the item actually has a value. While you can foreach() an empty array, with empty your code can already detect that the array is empty and the foreach will never be entered. This revised code should help you better understand the variations in the data: if (!empty($inventories['rgDescriptions'])) { foreach ($inventories['rgDescriptions'] as $key => $description) { if (!empty($description['descriptions'])) { foreach ($description['descriptions'] as $key => $effects2) { var_dump($effects2); } } } } This reveals that app_data is an array that exists in some entries, and when it does, appears to have key/value pairs. array(3) { ["value"]=> string(15) " Death Stare" ["color"]=> string(6) "4b69ff" ["app_data"]=> array(1) { ["def_index"]=> string(5) "31225" } } array(3) { ["value"]=> string(24) " Spooky Head-Bouncers" ["color"]=> string(6) "4b69ff" ["app_data"]=> array(1) { ["def_index"]=> string(5) "31209" } } A useful function for finding out if an array has a particular key is array_key_exists. This helps you determine if the app_data array contains a 'def_index' value or not. There are many entries in your data that don't have one. Putting this all together, I added code to output the item 'value' which appears to be a name, and the def_index value you wanted. I don't have any idea what that value actually is, so I included the name to make this demonstration somewhat interesting. Frequently the name has whitespace in it, so I used trim() to remove that. if (!empty($inventories['rgDescriptions'])) { foreach ($inventories['rgDescriptions'] as $key => $description) { if (!empty($description['descriptions'])) { foreach ($description['descriptions'] as $key => $effects2) { // var_dump($effects2); if (!empty($effects2['value']) && !empty($effects2['app_data'])) { if (array_key_exists('def_index', $effects2['app_data'])) { echo trim($effects2['value']) . ": {$effects2['app_data']['def_index']}" . PHP_EOL; } } } } } } Oh Deer!: 31245 Jolly Jester: 31243 Merry Cone: 31247 Hat Chocolate: 31259 Elf-Made Bandanna: 31260 Seasonal Spring: 31244 Elf Ignition: 31253 Train Of Thought: 31254 Seasonal Employee: 31258 ....
  21. Almost forgot to say that I edited your original post because it appeared to contain your actual gmail password. I would change your gmail password ASAP if it actually was the real one.
  22. These type of contact pages don't work very well for a number of reasons, most notably that bots fill your inbox with spam. This particular script can also be exploited by anyone (and again mostly it will be bots) to send email from your account, via this line: $mail->addAddress($mail_from_email, $mail_from_name); // Add a recipient I can spam your form, put a bunch of porn site links in the body, and have my from address be some person I want to spam with those links, and your gmail will send them a copy of the email. That line should be commented out at very least. As Req already noted, we need some debugging information, because we have no idea at what point where the script fails.
  23. It seems very likely that it is a missing plugin that handled message attachments.
  24. Maybe try a newer telnet client library like: https://github.com/graze/telnet-client
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.