zoom.us – Is it possible to use a completely custom made HTML email template for Registration Confirmation email on Zoom?

Recently, my client started using Zoom for their official meeting and he wants me to create a completely custom made HTML email which he will be able to upload on Zoom and send to others whenever necessary.

Unfortunately, I don’t have direct access to the Zoom account. I’m looked on internet for a documentation to follow. I have got no useful information so far. But I’m beginning to assume that it may not be possible to use a completely custom made HTML email template on Zoom.

Could anybody who has experience with Zoom give me some information about this.

mysql – How secure is my PHP registration script?

I coded a registration form and was wondering if anyone could give me feedback on whether I’m lacking any major security mechanisms. I’ve done loads of reading around the topic and feel it should be secure but expert feedback would be great.

Registration script

<?php

// User/pass only used locally
$host = 'localhost';
$db   = 'new_db';
$user = 'root';
$pass = '';

$options = (
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   => false,
);
$dsn = "mysql:host=$host;dbname=$db";
try {
     $pdo = new PDO($dsn, $user, $pass, $options);
} catch (PDOException $e) {
     throw new PDOException($e->getMessage(), (int)$e->getCode());
}


$errors = ();
if ( $_POST )
{

    // Get form field values
    $fname              = filter_input(INPUT_POST, 'fname', FILTER_SANITIZE_STRING);
    $email              = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
    $pwd                = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);
    $pwd_confirm        = filter_input(INPUT_POST, 'confirm-password', FILTER_SANITIZE_STRING);

    // Generate activation key
    $activation_key     = md5(uniqid(mt_rand(), true));
    $activation_link    = 'https://www.example.com/activate?id='.$activation_key.'&name='.$fname;

    // Check if passwords match
    if ($pwd !== $pwd_confirm) {
        $errors() = "Passwords don't match";
    }

    // Check if password is secure
    if (strlen($pwd) < 8) {
        $errors() = "Password not long enough! Must be at least 8 characters long";
    }

    // Check if username equals password
    if ($fname === $pwd) {
        $errors() = "Your name cannot be your password!";
    }

    // Check if email address exists in database
    $email_query = $pdo->prepare("SELECT * FROM users WHERE email = :email");
    $email_query->bindParam(':email', $email);
    $email_query->execute();
    $email_found = $email_query->fetchColumn();
    if ($email_found) {
        $errors() = "Your email address is associated with another account.";
    }


    // If no errors, continue with user account creation
    if (!$errors)
    {   
        // Hash password
        $hashed_password = password_hash($pwd, PASSWORD_DEFAULT);

        // Create database entry
        $create_account = $pdo->prepare("INSERT INTO users (first_name,email,password, activation_key) VALUES (:fname, :email, :password, :activation_key)");
        $create_account->bindParam(':fname', $fname);
        $create_account->bindParam(':email', $email);
        $create_account->bindParam(':password', $hashed_password);
        $create_account->bindParam(':activation_key', $activation_key);
        $create_account->execute();

        // Send out activation email
        $message = "Your Activation Code is ".$code."";
        $to=$email;
        $subject="Activate your account";
        $from = 'no-reply@example.com';
        $body='Thank you for creating your account, '.$fname.'. Please click on the following link to activate your account: <a href="'.$activation_link.'">'.$activation_link.'</a>';
        $headers = "From:".$from;
        mail($to,$subject,$body,$headers);

        // Redirect user to the dashboard
        header("Location: /dashboard.php");
        exit;
    }



}

?>

I do want to use it on a live site at one point, so the end result should not just be a registration form that’s somewhat secure but could actually be used in production.

Generate custom code from registration form

I need to generate a custom code, kind of a hash code, from a field received in a form.

The code would be a function calculated from this particular field (a 6-digit number), and it has a few limitations: It has exactly 4 digits, and all digits must be between “1” and “3”… for instance “3221”, “1431”, etc. I already have the formula in an excel-like format. It´s OK if different field values return the same code in some cases.

How can I make this custom function to read the field from the form, calculate the code with my formula, and show it to the user or send it by e-mail? Is it feasible?

Thanks in advance!

user registration – On multisite, plugins are disabled prematurely when viewing the /wp-activate.php page file

On multisite, setting the WP_INSTALLING constant on wp-activate.php file disables all plugins prematurely. Why didn’t the core create a way to bypass this. Though this may be required for activating new sites, but by default when activating a new user, the WP_INSTALLING constants should be disabled.

Magento registration form modification

My client asking a requirement for replacing email as mobile number with OTP verification. Is there any ways to remove email from required fields. If so it would cause any issue on checkout or order processing.

python – Cloud user registration

I developed an app that stores user-generated content in a local sql-lite database.

I would now provide the feature to the user to sync automagically its database with a cloud service. Ideally, I would like to set-up a framework that is easily up-scalableand that could provide a “serious” interface to the external world.

My issue is: I have really and totally NO IDEA on how this should be done. I mean, I am able to write a code in java or python that allows a someone to register to my service using username and password; but I would let it run on my raspberry py on my local network and not expose to the Internet.

I read names online about Django, Flask, Ruby… I have no idea on the differences between all of them and I don’t knbow what’s the best practice to provide such kind of design I would like to create.
Furthermore, I want my app to be able to sync with my service so I suppose that forms to fill are not way to go. I understand that these are web-based methods, so I have to rely on POST and GET methods, so I have to expose some API. But again, I am launching fancy words here and there.

So, question here:

How do I create a cloud-based service that requires user registration to sync user data with a mobile app?

Bonus question: what should I expose/provide to allow 3rd part services like Alexa to access a user database and perform operations on that (like reading it aloud)?

Please, note that also some pointer to keywords to study, or wathever else would be gladly appreciated.

Kind Regards

validity of auth token in OAuth2 in SharePoint App Registration/ Azure AD app

I have a SharePoint app registered in a site

To access the documents, I am getting the Auth Token from the below URL

https://accounts.accesscontrol.windows.net/{{realm}}/tokens/OAuth/2

What is the validity of the auth token that we get from this URL?

I am not able to find the validity of the token specified anywhere

User Registration Not Working In Heroku (Python Flask Framework)

I am trying to register a user in my blogging application. It works fine in local server. But when I deployed it to Heroku, it gives me 500 status code error.

Problem: Status Code 500 while trying to register a user in Heroku.

The code are as follows:

models.py

class User(UserMixin, db.Model):
    id = db.Column(db.Integer, primary_key = True)
    username = db.Column(db.String(64), index = True, unique = True)
    firstname = db.Column(db.String(50))
    middlename = db.Column(db.String(50))
    lastname = db.Column(db.String(50))
    dob = db.Column(db.DateTime)
    email = db.Column(db.String(120), index = True, unique = True)
    password_hash = db.Column(db.String(128))

    def __repr__(self):
        return "<User {}>".format(self.username)

    def set_password(self, password):
        self.password_hash = generate_password_hash(password)

forms.py

class RegistrationForm(FlaskForm):
    username = StringField("Username", validators = (DataRequired(message = "Username is required.")), render_kw = {"placeholder": "Username"})
    firstname = StringField("First Name", validators = (DataRequired(message = "First Name is required.")), render_kw = {"placeholder": "First Name"})
    middlename = StringField("Middle Name", render_kw = {"placeholder": "Middle Name"})
    lastname = StringField("Last Name", validators = (DataRequired(message = "Last Name is required.")), render_kw = {"placeholder": "Last Name"})
    dob = DateField("Date Of Birth", validators = (DataRequired(message = "Date Of Birth is required.")), format = "%Y-%m-%d")
    email = StringField("Email", validators = (DataRequired(message = "Email Address is required.")), render_kw = {"placeholder": "Email Address"})
    password = PasswordField("Password", validators = (DataRequired(message = "Password is required.")), render_kw = {"placeholder": "Password"})
    confirm_password = PasswordField("Repeat Password", validators = (DataRequired(message = "Password Confirmation is required."), EqualTo("password")), render_kw = {"placeholder": "Confirm Password"})
    submit = SubmitField("Register")

    def validate_username(self, username):
        user = User.query.filter_by(username = username.data).first()
        if user is not None:
            raise ValidationError("Username Already Exists! Please Use A Different Username.")
    
    def validate_email(self, email):
        user = User.query.filter_by(email = email.data).first()
        if user is not None:
            raise ValidationError("Email Address Already Exists! Please Use A Different Email Address.")

routes.py

@app.route("/register", methods = ("GET", "POST"))
def register():

    if current_user.is_authenticated:
        return redirect(url_for("dashboard"))

    form = RegistrationForm()

    if form.validate_on_submit():
        user = User(username = form.username.data, email = form.email.data, firstname = form.firstname.data, middlename = form.middlename.data, lastname = form.lastname.data, dob = form.dob.data.strftime("%Y-%m-%d"))
        user.set_password(form.password.data)
        db.session.add(user)
        db.session.commit()
        flash("Congratulations! You are now a registered user.", "success")
        return redirect(url_for("login"))

    return render_template("register.html", title = "User Registration", form = form)

register.html

<form action="" method="POST">
    {{ form.hidden_tag() }}
    <div class="form-group">
        <input type="text" class="form-control" name="username" placeholder="Username">
        {% for error in form.username.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        <input type="text" class="form-control" name="firstname" placeholder="First Name">
        {% for error in form.firstname.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        <input type="text" class="form-control" name="middlename" placeholder="Middle Name">
        {% for error in form.middlename.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        <input type="text" class="form-control" name="lastname" placeholder="Last Name">
        {% for error in form.lastname.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        <div class="input-group">
            <label for="dob" class="col-form-label">Date Of Birth</label>&emsp;
            <input class="col-md-9 datepicker" id="dob" name="dob" type="date">
        </div>
        {% for error in form.dob.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        <input type="text" class="form-control" name="email" placeholder="Email Address">
        {% for error in form.email.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        <input type="password" class="form-control" name="password" placeholder="Password">
        {% for error in form.password.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        <input type="password" class="form-control" name="confirm_password" placeholder="Confirm Password">
        {% for error in form.confirm_password.errors %}
            <span style="color: red;">{{ error }}</span>
        {% endfor %}
    </div>
    <div class="form-group">
        {{ form.submit(class="btn btn-block btn-outline-info") }}
    </div>
</form>

Heroku Application Log

2020-06-30T14:30:31.934555+00:00 app(web.1): Message: 'Exception on /register (POST)'
2020-06-30T14:30:31.934555+00:00 app(web.1): Arguments: ()
2020-06-30T14:30:31.943840+00:00 app(web.1): 10.43.184.146 - - (30/Jun/2020:14:30:31 +0000) "POST /register HTTP/1.1" 500 4924 "https://memoryblog.herokuapp.com/register" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
2020-06-30T14:30:31.951860+00:00 heroku(router): at=info method=POST path="/register" host=memoryblog.herokuapp.com request_id=31cb3cc1-c089-4b54-a35f-1a43050ef91a fwd="27.140.254.125" dyno=web.1 connect=1ms service=1558ms status=500 bytes=5290 protocol=https

Can anyone help me to solve this problem?

wordpress – Country selection in registration + hide fields based on country selection

I have added some customized registration fields to my website by using the code below.

  1. I am looking to also add a custom field of ‘country’ in drop down selection. What code is needed to be added to the code below to have ‘billing_country’ in select dropdown to shown below the ‘billing_phone’ field?

  2. I’d like to add a conditional logic that if ‘united states’ is chosen, only then, the the two fields for “license number” and “agd” will show, and otherwise will remain hidden.

Please advise and let me know if my question is clear enough. thank you in advance 🙂

       <p class="form-row form-row-first">
       <label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?><span class="required">*</span></label>
       <input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST('billing_first_name') ) ) esc_attr_e( $_POST('billing_first_name') ); ?>" />
       </p>
       <p class="form-row form-row-last">
       <label for="reg_billing_last_name"><?php _e( 'Last name', 'woocommerce' ); ?><span class="required">*</span></label>
       <input type="text" class="input-text" name="billing_last_name" id="reg_billing_last_name" value="<?php if ( ! empty( $_POST('billing_last_name') ) ) esc_attr_e( $_POST('billing_last_name') ); ?>" />
       </p>
       <p class="form-row form-row-wide">
       <label for="reg_billing_phone"><?php _e( 'Phone', 'woocommerce' ); ?><span class="required">*</span></label>
       <input type="text" class="input-text" name="billing_phone" id="reg_billing_phone" value="<?php esc_attr_e( $_POST('billing_phone') ); ?>" />
       </p>
       <div class="clear"></div>
       <p class="form-row form-row-wide">
       <label for="reg_license_number"><?php _e( 'License Number', 'woocommerce' ); ?></label>
       <input type="text" class="input-text" name="license_number" id="reg_license_number" value="<?php esc_attr_e( $_POST('license_number') ); ?>" />
       </p>
       <div class="clear"></div>
       <p class="form-row form-row-wide">
       <label for="reg_agd"><?php _e( 'AGD ID', 'woocommerce' ); ?></label>
       <input type="text" class="input-text" name="agd" id="reg_agd" value="<?php esc_attr_e( $_POST('agd') ); ?>" />
       </p>
       <div class="clear"></div>
       <?php
 }
 add_action( 'woocommerce_register_form_start', 'wooc_extra_register_fields' );


/**
* register fields Validating.
*/
function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) {
      if ( isset( $_POST('billing_first_name') ) && empty( $_POST('billing_first_name') ) ) {
             $validation_errors->add( 'billing_first_name_error', __( '<strong>Error</strong>: First name is required!', 'woocommerce' ) );
      }
      if ( isset( $_POST('billing_last_name') ) && empty( $_POST('billing_last_name') ) ) {
             $validation_errors->add( 'billing_last_name_error', __( '<strong>Error</strong>: Last name is required!.', 'woocommerce' ) );
      }
          if ( isset( $_POST('reg_billing_phone') ) && empty( $_POST('reg_billing_phone') ) ) {
             $validation_errors->add( 'billing_phone_error', __( '<strong>Error</strong>: Phone is required!', 'woocommerce' ) );
      }


         return $validation_errors;
}
add_action( 'woocommerce_register_post', 'wooc_validate_extra_register_fields', 10, 3 );




/**
* Below code save extra fields.
*/
function wooc_save_extra_register_fields( $customer_id ) {
    if ( isset( $_POST('billing_phone') ) ) {
                 // Phone input filed which is used in WooCommerce
                 update_user_meta( $customer_id, 'billing_phone', sanitize_text_field( $_POST('billing_phone') ) );
          }
      if ( isset( $_POST('billing_first_name') ) ) {
             //First name field which is by default
             update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST('billing_first_name') ) );
             // First name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST('billing_first_name') ) );
      }
      if ( isset( $_POST('billing_last_name') ) ) {
             // Last name field which is by default
             update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST('billing_last_name') ) );
             // Last name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST('billing_last_name') ) );
      }
          if ( isset( $_POST('license_number') ) ) {
             // Last name field which is by default
             update_user_meta( $customer_id, 'license_number', sanitize_text_field( $_POST('license_number') ) );
             // Last name field which is used in WooCommerce
             update_user_meta( $customer_id, 'license_number', sanitize_text_field( $_POST('license_number') ) );
      }
          if ( isset( $_POST('agd') ) ) {
             // Last name field which is by default
             update_user_meta( $customer_id, 'agd', sanitize_text_field( $_POST('agd') ) );
             // Last name field which is used in WooCommerce
             update_user_meta( $customer_id, 'agd', sanitize_text_field( $_POST('agd') ) );
      }
}
add_action( 'woocommerce_created_customer', 'wooc_save_extra_register_fields' );```