username

Refresh user name in navbar after username has changed (Using Asp.Net, MVC and C#)

时光总嘲笑我的痴心妄想 提交于 2019-12-07 20:35:30
I am trying to update the user name in the navbar (using ASP.NET, MVC, C#) after a user has changed his or here user name when signed in. So the user name is shown, but when it's changed the old user name is still being displayed in the navbar until the user loges out and in again. Dose any one know how to display the new user name in the navbar in a nice way? This is a short version of how the navbar looks like: <nav class="navbar navbar-default navbar-fixed-top"> @if (Request.IsAuthenticated) { @Html.AntiForgeryToken() <a href='@Url.Action("Index", "Manage")'>@User.Identity.GetUserName()</a>

How to print the current user and system name in Unix?

血红的双手。 提交于 2019-12-07 12:29:41
问题 Please i am looking forward to learn how to print the current logged-in user and system name in Unix. #include <unistd.h> #include <fcntl.h> using namespace std; int main(int argc, char **argv) { //Print the current logged-in user / username. //Print the name of the system / computer name. return 0; } I would be grateful if you can provide a line of code or two as demonstration. Thanks 回答1: getuid() gets the id not the username. To get the username you'll have to additionally use getpwuid() :

ASP.NET-Identity limit UserName length

南楼画角 提交于 2019-12-07 01:06:05
问题 How can I limit the UserName field in the table AspNetUsers ? Neither this: public class ApplicationUser : IdentityUser { [Required, MaxLength(15)] public string UserName { get; set; } } or this: modelBuilder.Entity<ApplicationUser>().Property(x => x.UserName).HasMaxLength(15); works. I need this because setting an Index on an nvarchar(max) gives me this error msg: Column 'UserName' in table 'dbo.AspNetUsers' is of a type that is invalid for use as a key column in an index. To be verbose, I

PHP Login with Username/Password

梦想的初衷 提交于 2019-12-06 14:52:06
How would I edit the PHP below to allow for additional or multiple user names and passwords. For example User1 with Password JHFDE3, User2 with Password LKFW34, etc. From what I have read, an associative array would likely be best. There is no database, it is hardcoded to simply login and be able to view a php page. For the particular code below, how would I make it into an associative array? Thank you. <?php session_start(); //initiates the sessions if ($_POST['submit']) //checks to make sure the login form has been submitted { $user = "XXXXX"; $pass = "XXXXXXX"; if ($_POST['pass'] == $pass &

Incorrect username / password message and redirect

柔情痞子 提交于 2019-12-06 14:42:33
问题 Creating a Client Login area. I have my log in form in a clientLogin.html: <form name="ClientLogin" method="post" action="login.php"> <br> <p> <label for='Username'>Username</label> <br> <input type="text" name="username" /> </p> <p> <label for='Password'>Password</label> <br> <input type="password" name="password" /> </p> <br> <input type="submit" value="Submit" /> </form> If the username & password combination are incorrect I want to redirect to this page adding a message saying "incorrect

How to make url /username in codeigniter?

∥☆過路亽.° 提交于 2019-12-06 13:41:22
I'm using codeigniter at the moment. I am currently able to view a persons profile by the using /user/profile/profile_id but I want to make it so that a user can just navigate to a profile using /username to make it simpler. How would I go about doing this I'm not sure where to start? class User extends CI_Controller{ public function index(){ if($this->session->userdata('is_logged_in')){ redirect('user/profile'); } } public function profile(){ $profile_id = $this->uri->segment(3); $ip = $this->session->userdata('ip_address'); $curr_user = $this->session->userdata('id'); $data['profile'] =

Php Ensuring a unique username

会有一股神秘感。 提交于 2019-12-06 10:38:48
问题 I have a register page and I want to ensure that usernames are unique. I have tried all the solutions on here already and nothing is working for me. This is the error I'm currently getting: Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\project\projectregistered.php on line 16 Query was empty Here is my php: <?php $con=mysqli_connect("localhost","root","","test"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli

tortoise svn shows useid, how can I change displayed name for author

时光怂恿深爱的人放手 提交于 2019-12-05 21:33:39
问题 Our org uses funny user ids - rzhxxn etc. In tortoise svn log/blame etc, i want to see the author name. Is there anyway to create a mapping file to see the real name instead of id? 回答1: No, Subversion takes your user account (i.e. authenticated account's) name as svn:author property. There is no way for you, as a regular user (i.e. non-admin) to change it. 来源: https://stackoverflow.com/questions/23275056/tortoise-svn-shows-useid-how-can-i-change-displayed-name-for-author

How to print the current user and system name in Unix?

倾然丶 夕夏残阳落幕 提交于 2019-12-05 13:34:30
Please i am looking forward to learn how to print the current logged-in user and system name in Unix. #include <unistd.h> #include <fcntl.h> using namespace std; int main(int argc, char **argv) { //Print the current logged-in user / username. //Print the name of the system / computer name. return 0; } I would be grateful if you can provide a line of code or two as demonstration. Thanks getuid() gets the id not the username. To get the username you'll have to additionally use getpwuid() : struct passwd *passwd; passwd = getpwuid ( getuid()); printf("The Login Name is %s ", passwd->pw_name); See

storing credentials in android

余生颓废 提交于 2019-12-05 08:13:42
问题 how should i store user credentials in my app i'm creating for myself? i'm not setting up any servers i'm just installing the app directly to my phone via USB. what i'm trying to do is have myself enter a username/password to associate to the account, basically the same as most other apps. the only difference is i'm not setting up any servers since i'm new and would have no idea how to do that. so with this in mind could i get away with storing in a database and pulling the info from there,