Disable user registration email in Joomla 3.5 - joomla

In Joomla 3.5 I would like to disable the email a user will get if he registers. I have a setup where a user can register himself to my site. However the user always gets an email with registration. I would like to disable this however can not find the proper place.
Thank you for any help.

It looks like the guilty code is located at:
/components/com_users/models/registration.php line 538 (Joomla! 3.5.1).
// Send the registration email.
$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);
There is no condition at all that would avoid this line by any means.
Probably the only option you've got is to override the com_users component:
https://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core
Use the Mvc override plugin, even if it's not that stable, it should do the job.

Related

Laravel6 - Email verification customization on multi-login platform

I am new to laravel. I am trying to implement email verification on my laravel6 project.
On my project, there're three user types named 'user' 'vendor' and 'admin'. I have prepared separate directories for each user type in 'Controllers' and each of them has their own Auth files (e.g. Directory 'App/Http/Controllers/Vendor/Auth' has its own VerificationController.php, etc). So far, I've successfully implemented registration and login/logout function for each type with separate table in my DB.
A issue popped up when I tried to implement email verification. When I tried to access to a page where email verification is required, 'Auth\VerificationController#show' method seemed to be called regardless of the user type.
I went over laravel source code and learned that within the process, router calls Illuminate/Routing/Router->emailVerification() method. And the emailVerification() method routes to 'Auth\VerificationController#show' regardless of the user type.
What I wanted to do is to route depending on user type (e.g. if 'vendor' tries to login, I want to call 'Vendor\Auth\VerificationController#show').
I don't come up with any idea how to do for that. Can anyone please give me any advice?
Illuminate\Routing\Router class
public function emailVerification()
{
$this->get('email/verify', 'Auth\VerificationController#show')->name('verification.notice');
$this->get('email/verify/{id}/{hash}', 'Auth\VerificationController#verify')->name('verification.verify');
$this->post('email/resend', 'Auth\VerificationController#resend')->name('verification.resend');
}
Thank you in advance.

Where to check if an User is logged in in a Laravel Application?

I've been using your advice and View::sharing all of my important data to all views. However, there is one issue I have encountered.
This code:
if(!Auth::guest()){
$user=Auth::user()->id;
}
else $user=0;
$temp=DB::select('query');
View::share('cartnumber', count($temp));
View::share('cartitems', $temp);
doesn't work when put in AppServiceProvider. Or better, it always sets $user=0, even if I am logged in. I thought it is because AppServiceProvider's boot function executes before the site checks if someone is logged in.
I then tried to use a BaseController with a construct function but that doesn't work either. The only solution that seems to work correctly is putting the code in every single Controller for every view! That actually works, which kind of confirms my theory.
But is there anywhere I can put this code without having to copy/paste it in every single Controller? Thanks in advance!
You'd likely want to put this code later in the request life cycle to guarantee an auth user because as others have mentioned middleware/session code has not occured during this part of the framework booting up. You could use a service class to call in all your controllers to avoid the copy pasting. Or If you'd like to achieve this using code in your service provider you could use a View Composer instead of a share this allows you to define a callback/or class that will be called right before the view is returned
view()->composer(['/uri-that-needs-data'], function ($view) {
if (Auth::check()) {
$cart = DB::query(...)->get();
$view->with('cartitems', $cart);
}
});
Check out https://laravel.com/docs/5.7/views#view-composers for more details.
Auth::user() will be empty until the session middleware has run.
The reason you can't access the user inside your service provider is because that code is run during the "bootstrapping" phase of the application lifecycle, when it's doing things like loading filesystem or cache drivers, long before the request is sent through response handlers (including middleware).
Once the application has been bootstrapped and all service providers
have been registered, the Request will be handed off to the router
for dispatching. The router will dispatch the request to a route or
controller, as well as run any route specific middleware.
Source: https://laravel.com/docs/5.7/lifecycle
If you don't want to copy/paste that code everywhere, then one place to put it is in custom route middleware. You can list it after the auth middleware to guarantee a logged-in user.
Edit: View composers are another really good option, as suggested by #surgiie. The reason these can be set up inside a service provider (unlike your example) is because the view composer registers a callback, but doesn't execute it until a much later stage in the application lifecycle.

Codeigniter FacebookSDK, base_facebook.php library

Hello there I am listing now the base_facebook.php file and can't see in there a function which gives back the username of the user. There is only a function getUser() which returns the user ID. Can you navigate me about the way how to take the username of a user with this FB SDK in codeigniter ?
You would need to make an API call to get the user details:
$me = $facebook->api('/me');
var_dump($me);
Although, the username is not included anymore since v2.0, for privacy reasons.
This is for the old PHP SDK btw, but i assume that is what you are using. The new one works completely different and needs PHP 5.4+. Here´s a tutorial, just in case: http://www.devils-heaven.com/facebook-php-sdk-4-0-tutorial/

Can't login into magento 1.8.1.0 on localhost on wamp server using correct username and password

I have fresh installed magento 1.8.1.0 on localhost with wamp server. Everything has been installed correctly but when i login into the login page with correct username and password it opens the same login page and not get into dashboard page.
I had read a lot of threads saying to make changes in variens.php by opening Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
When i open app/code/core/ i can't find mage folder in core folder.
Please help how can i fix it?
thank you
kamaldeep singh
I don't have the folder mage inside the app/code/core. But i read some thread and made changes using 127.0.0.1/mymagento/index.php/admin in address bar by editing my C:/Windows/system32/drivers/etc/hosts it went to dashboard page
And appears error on dashboard
Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\wamp\www\mymagento\lib\internal\Magento\Framework\Code\Reader\ClassReader.php on line 77
i checked classReader.php on line 77 but there is no line related to nesting level to edit.
When i refresh the dashboard page it opens the login page. when i try to login with correct username and password it opens the same login page and no error like invalid username or password.
If you don't have the Mage folder inside app/code/core your website should not work at all. That folder is essential to run Magento. Check again.
About your problem, do you get any error (wrong username, password, etc.)?
Do you mean a customer cant login, or you cant log into the backend, there is an existing issue with customer login depending on the version of magento you might be using.
find : app/design/frontend/(themepackage(/(theme)/template/customer/form/login.phtml
under
<ul class=”form-list”>
paste in
<input type=”hidden” name=”form_key” value=”<? echo Mage::getSingleton(‘core/session’)->getFormKey(); ?>” />
And in app/design/frontend/(themepackage(/(theme)/template/persistent/customer/form/login.phtml
Apply the same changes.
Clear cache.
Customers should then be able to login.
Resource
Does it says that username or password is wrong or only refreshes the page without any error messages? If there are no errors then try to delete cookies for your host and then login again. Usually it helps.
Are you using chrome? If so, try Firefox. Another option might be to use 127.0.0.1/... instead of localhost/...
In your magento installed folder, go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php And comment out the lines 96 to 112 in v1.9. Lines may differ due to version. Look for lines that looks like this below:
// session cookie params
/** $cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
**/
Have fun :)
If you have this problem on non FireFox browser(s), use FireFox to execute this action below and try login in with your non FireFox browser(s) again to confirm. I had this issue with Chrome.
Go to System > Configuration > Web > Session Cookie Management. And change Use HTTP Only from YES to NO.

"Server Error" when users try to create a new account - Magento 1.7

I'm setting up our Magento 1.7 store, hoping to be ready for launch soon. I've noticed a problem:
When users try to create a new account, they fill out their info on /customer/account/create page just fine, then when they click submit, they get this 500 Error:
The website encountered an error while retrieving
http://example.com/customer/account/createpost/.
the account is actually created, however.
Similar deal on when users submit their email on the Forgot Password page, they press submit and get this:
The website encountered an error while retrieving
http://example.com/customer/account/forgotpasswordpost/.
no email is sent.
If you see this and know how to help with this prob, your advice would be much appreciated, truly.
In case it helps, we are using a theme, rather than default.
EDIT - (I was asked if I had checked server error)
My server errors show as this, for the above situations:
Forgot Password submit shows this error:
Fatal error: Call to undefined method Mandrill_API::addTo() in
D:\Magento\app\code\core\Mage\Core\Model\Email\Template.php on line
438
and
Create Account submit shows this error:
Fatal error: Call to undefined method Mandrill_API::addTo() in
D:\Magento\app\code\core\Mage\Core\Model\Email\Template.php on line
438
as well.
Here is 6 lines(437-442) of that Template.php file:
foreach ($emails as $key => $email) {
$mail->addTo($email, '=?utf-8?B?' . base64_encode($names[$key]) . '?=');
}
$this->setUseAbsoluteLinks(true);
$text = $this->getProcessedTemplate($variables, true);
[UPDATE]
I've learned that when I enter a random, fake email for Forgot Password, and press submit, a confirmation appears, saying something like "If this email exists, then a new email was sent to that email!", but when I submit an email of a real existing customer, then it gives me the 500 error I've mentioned.
Still nothing - if anyone out there sees this, and you have a bit of time to help solve this perhaps, may Talos bless you!
[SOLVED]
I turns out this was a problem with transaction emails.
Cause by an extension, Mandrill, which is added to magento when I installed the MailChimp extension, called "MageMonkey - MailChimp Integration by ebizmarts"
Once I enabled Mandrill, in config, advanced, all transactions and transaction emails work perfectly fine!
It's possible that it's a .htaccess or server configuration problem. Where is it hosted? Do you have a .htaccess file in the root of the installation?

Resources