Edit joomla registration admin email - joomla

I want to change the email the admin gets when when a new user is being registered.
I want to add field he gets about the user.
I tried changing the en-GB.com_user file
(although eventually I need it in Russian, but that's besides the point)
It didn't help.
When I tried a language override, I couldn't register new users at all.
I'm still guessing I can do it through language override by adding the right text
I just don't have a clue of what to write instead of : %s \n E-mail: %s \n
what does the \n %s \n mean?
I guess that somehow I need to change the COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY
but HOW and WHERE?

I have figured it out.
Find /home/joomla/public_html/components/com_users/models/registration.php
and add:
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY',
$data['sitename'],
$data['name'],
$data['email'],
$data['username'],
$data['yourdatabasecolumn'],
$data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation']
);
Find /home/joomla/public_html/language/en-GB/en-GB.com_users.ini
and add:
COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at %s.\nThe user has verified his email, and requests that you approve his account.\nThis email contains their details:\n\n Name : %s \n Email: %s \n Username: %s \n Yourdatabasename : %s \nYou can activate the user by clicking on the link below:\n %s \n"
everything must be in the right order

Related

create an command which sends an email to the admin Laravel

Hello every one i wanna create an command which sends an email to the admin containing the modification / deletion report + access in a table (use the data in the log file) can someone help me please
for example this is my observer it log the actions in a file so how can i make a command which sends an email to the admin containing this actions from the log file ?
public function created(AppKey $appKey)
{
Log::channel('obsinfo')
->info("id : ".$appKey->id." type : ".$appKey->type." , datetime : ".now()." operation :Creation , ip :".\Request::ip()." userAgent: ".\Request::server('HTTP_USER_AGENT'));
return true;
}

How to configure RoundCubeMail so I can log in

I am trying to set up roundcubemail on a mac so that I can eventually add an email-pipe to service certain emails. I have followed the installation and configuration options the best I can, and the tests show no problems except with the test send an email and the iMap test. The instructions are not very clear about how to set up parts of the config.inc.php. Here is my config.inc.php:
<?php
/* Local configuration for Roundcube Webmail */
// ----------------------------------
// SQL DATABASE
// ----------------------------------
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password#host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// Note: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
// or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
// Note: Various drivers support various additional arguments for connection,
// for Mysql: key, cipher, cert, capath, ca, verify_server_cert,
// for Postgres: application_name, sslmode, sslcert, sslkey, sslrootcert, sslcrl, sslcompression, service.
// e.g. 'mysql://roundcube:#localhost/roundcubemail?verify_server_cert=false'
$config['db_dsnw'] = 'mysql://roundcubemail:roundcubemail_db_password#localhost/roundcubemail';
// Syslog ident string to use, if using the 'syslog' log driver.
$config['syslog_id'] = 'webmail';
// ----------------------------------
// IMAP
// ----------------------------------
// The IMAP host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '#' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
// required to match old user data records with the new host.
$config['default_host'] = 'localhost';
//$config['default_host'] = 'ssh://%n';
$config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
'verfify_peer_name' => false,
),
);
$config['smtp_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
),
);
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = 'mailto://support_email';
// This key is used for encrypting purposes, like storing of imap password
// in the session. For historical reasons it's called DES_key, but it's used
// with any configured cipher_method (see below).
$config['des_key'] = 'aKey';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Webmail';
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('archive', 'attachment_reminder', 'emoticons', 'markasjunk', 'new_user_dialog', 'userinfo', 'vcard_attachments');
// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$config['language'] = 'en_US';
The iMap and ssl portions are what is confusing to me. I would like to use the email server on localhost to send emails. The problem is that after I get it installed, when I access http://localhost/webmail, a login form shows up. I don't know what to enter for userid or password as I've never specified them when doing the configuration. I selected auto add new users, but nothing happens.
This is the log entry:
[18-May-2020 19:29:54 -0400]: <d2s7trm8>
IMAP Error: Login failed for userid against localhost from 127.0.0.1(X-Forwarded-For: ::1).
Authentication failed. in /Library/Server/Web/Data/Sites/Default/webmail/program/lib/Roundcube/rcube_imap.php
on line 200 (POST /webmail/?_task=login&_action=login)
What steps do I take to get the iMap and ssl ( if I need it ) to work?
I believe I found my error. Ignorance on my part. I was able to log into my round cube webmail on my own server by logging in using my account username and password. I had set the IMAP server to be local host but kept thinking I was supposed to use my local (Apple) email address or such.
When reading installations, it is important to understand that the writer knows things you don’t and doesn’t always explain in detail things that are obvious to them. Reading on the side things about how IMAP servers actually work helped out here to clarify what some of the terms were talking about.
Nice interface once you get logged in!

How to check whether a file contains "." (dot) operator

I have a code which asks user to upload a file. The file may be audio or image or anything. I asks user to enter file name. If he Enter file name my code adds extension to it. It is working fine. But if user enters extension say audio.mp3 then it saves as audio.mp3.mp3. So I have to check if user entered name contains dot then it should not take extension.
I used pregmatch but it is not working.
My code
$splitOptions = explode(',',$request->input('mediaName'));
$fileExtension = pathinfo($file[$i]->getClientOriginalName(),PATHINFO_EXTENSION);
$checkExtension = explode('.',$request->input('mediaName'));
if(preg_match("/[.]/", $checkExtension)){
$mediaName = $splitOptions[$i];
}
else
{
$mediaName = $splitOptions[$i]."_$fileExtension";
}
Please use laravel helper
$value = str_contains('This is my name', 'my');
// true

Magento 2 sucess/faliure message displaying + concatenated string.

Hello I am new to Magento (Magento 2.1) My problem is that when any message like sign up successfully or order successfully it is displayed word joining with + sign instead of space. like :
please help.
Provide the code where you concatenate the message. The message should be
$this->messageManager->addError( __('This is your error message.') );
//or
$this->messageManager->addError( __('Invalid %s or %s', 'login', 'password') );
//or replace with variables

Can not get signed in email using Office 365 REST API

I followed this post http://dev.office.com/code-samples-detail/2142 and Ruby to get user's email address. Here is the code:
# Parses an ID token and returns the user's email
def get_email_from_id_token(id_token)
# JWT is in three parts, separated by a '.'
token_parts = id_token.split('.')
# Token content is in the second part
encoded_token = token_parts[1]
# It's base64, but may not be padded
# Fix padding so Base64 module can decode
leftovers = token_parts[1].length.modulo(4)
if leftovers == 2
encoded_token += '=='
elsif leftovers == 3
encoded_token += '='
end
# Base64 decode (urlsafe version)
decoded_token = Base64.urlsafe_decode64(encoded_token)
# Load into a JSON object
jwt = JSON.parse(decoded_token)
# Email is in the 'preferred_username' field
email = jwt['preferred_username']
end
This function worked very well, I can get user's email address. But today, this function still works without error but the JSON I got not contain user's email address anymore.
Could someone help me? I want to get user's email address. Thank you !
Azure deployed a breaking change to the v2 app model, and you don't get user info by default anymore.
You can read all about it here: https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-preview-oidc-changes/, but to summarize:
The openid scope used to give you basic profile info for the user.
That wasn't in line with the OpenID standard
Azure changed to require that you request the profile scope to get access to that information
For that sample, find this bit:
# Scopes required by the app
SCOPES = [ 'openid',
'https://outlook.office.com/mail.read' ]
And change it to:
# Scopes required by the app
SCOPES = [ 'openid',
'profile',
'https://outlook.office.com/mail.read' ]
Please add profile and email in your scope :
SCOPES = [ 'openid',
'profile',
'email',
'https://outlook.office.com/mail.read' ]

Resources