Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Obi1-Cannabis

  1. Is it possible to extend the OAuthGrantResourceOwnerCredentialsContext class from Microsoft.Owin.Security.OAuth? when implementing my custom OAuthProvider I want to be able to add a new IList to the context in order to send messages that will be intercepted by Growl in AngularJs. what i want to do in case of an error for example is something like: public class CustomOAuthProvider : OAuthAuthorizationServerProviderExtended{ //removed code for brevity public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContextExtended context) { //removed code for brevity ApplicationUser user = await userManager.FindAsync(context.UserName, context.Password); if (user == null) { context.messages.Add(GeneralEx.CreateGrowlMessage("The company, user name or password is incorrect.", "error")); return; } //removed code for brevity }} where CreateGrowlMessage is public static GrowlMessage CreateGrowlMessage(string message, string severity) { GrowlMessage growlMessage = new GrowlMessage(); growlMessage.text = message; growlMessage.severity = severity; return growlMessage; } and GrowlMessage is public class GrowlMessage{ public string text; public string severity;} I was trying to extend both OAuthAuthorizationServerProvider and OAuthGrantResourceOwnerCredentialsContext shown bellow public class OAuthAuthorizationServerProviderExtended : OAuthAuthorizationServerProvider { public virtual Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContextExtended context) { return Task.FromResult<object>(null); } } public class OAuthGrantResourceOwnerCredentialsContextExtended : OAuthGrantResourceOwnerCredentialsContext { public OAuthGrantResourceOwnerCredentialsContextExtended(IOwinContext context, OAuthAuthorizationServerOptions options, string clientId, string userName, string password, IList<string> scope) : base(context, options, clientId, userName, password, scope) { } public IList<GrowlMessage> messages {get;set;} } but this is not having the desired effect. now all login attempts fail and all i get in the response is {"error":"invalid_grant"}
  2. according to this page: http://caniuse.com/css-variables the use of css variables will be available on firefox when they lauch version 31 for other browsers it seems like there's no info about whem they'll support this functionality
  3. Never mind, the problem was not with my configuration, that was correct... The problem was that the user hadn't fully configured the email accouint...
  4. I'm having trouble sending emails from an email like "mail@domain.com" wich is configured to use the live.mail.com client. Even though i think i'm using the right credentials i get the following error: "Mailbox unavailable. The server response was: 5.7.3 Requested action aborted; user not authenticated" this are my configurations: smtpClient = new SmtpClient("smtp.live.com");smtpClient.Port = 587;smtpClient.UseDefaultCredentials = false;smtpClient.Credentials = new System.Net.NetworkCredential("mail@domain.com", "Password");smtpClient.EnableSsl = true; any help is appreciated, for I can't seem to work-arround this problem and have to have this website online ASAP
  5. setting animation-fill-mode: forwards means that after the animation has completed execution i will hold at its final properties until the animation is removed. i guess i don't really understand what you are trying to acomplish.
  6. I say there's space for a lot of improvement here, the page looks overwhelmed even though there isn't that much information, you should make use of more clear space. the backgrounds should be more smooth to give it a more appealing to the eye feeling. also a more readable frendly font would be good this just for starters take a look at the Web Design Concepts section of this page http://www.w3.org/community/webed/wiki/Main_Page#Web_Design_Concepts study it and try to improve your overall design.
  7. You'll need to use -webkit-animation-fill-mode -webkit-animation-fill-mode: forwards; leaves the animation in the last frame -webkit-animation-fill-mode: backwards; leaves the animation in the start frame
  8. hey, thanks for the reply justsomeguy! i already found the problem the MySql Connector installed in the production server was a very old version. It's solved.
  9. I'm trying to figure this out for a few day now, i have custom membership and role providers for my project and it works perfectly on my dev machine, but on production it throws the following error for the web.config I've read about people having simmilar issues because they hadn't named their connectionstrings but that's not the case here... any toughts on what's going on here? if you need any more info just ask and i'll provide. thanks for any help
  10. one way to do that would be to use javascript to change the action property of your form before submiting
  11. I've already made my custom MemberShipProvider but now i would like to associate it with UserProfile using my specific fields. The problem is i can't find any good tutorial or article on how to do this...can anyone guide me in the right direction?by the way i'm a newbie to ASP.NET MVC3 and am using C#Edit: ok nevermind, i found what i was looking for.
  12. what thescientist said
  13. since UPDATE is a mysql reserved word you should use `update` when refering to the column mysql_query("UPDATE users SET `update` = `update` + 1 WHERE username = $show_username");
  14. no, you should not store any password on the session and if you want it only for admin you shoud have something to differentiate the admin from other users - a column isadmin(bit) set to 1 if the user is an administrator and to 0 if it's not.then when your user logs in you have to had that info to the session to.your $_SESSION["user"] would be something like $_SESSION["user"] = array("login"=>true,"username"=>"loged_user_name", "isadmin"=>true); when the user is an administrator, and then your code to show the edit link will be <?php...your code...if(isset($_SESSION["user"]["login"]) && $_SESSION["user"]["login"] == true && isset($_SESSION["user"]["isadmin"]) && $_SESSION["user"]["isadmin"] == true ){?> <a href="your_link">Edit</a><?php}...continue code...?>
  15. having $_SESSION["user"]["login"] whith default value being false when not logged-in then when a user logs-in you give this session var the value of true <?php...your code...if(isset($_SESSION["user"]["login"]) && $_SESSION["user"]["login"] == true){?> <a href="your_link">Edit</a><?php}...continue code...?>
  16. Your site is probably already indexed in the search engines. but in order to get it to show up at a better part of the results (1st page) you should have good notions of SEO an apply them properly.take a look at this articleand search the web for SEO good practices http://www.google.com/search?q=SEO+good+practices
  17. if i get you alright you wan't to hide the 'edit post' from non logged users.all you should do is check if loggedin is true add it to the page, otherwise don't.
  18. the code you've posted originaly should be working fine, are you sure that the id #webDesignLink and the path to your image are correct.try using the absolute path to your image intead of relative path just to be sure.
  19. ok thanks for clarification yes, but how come session_start() be considerided as an infinite loop? i'm prety sure it can't
  20. yeah!there was no blank lines, however re-saving the file explicitly as utf-8 seems to have solved this one, though this had never happened to me before and never heard about this, why does it happen?and what about the timeout? any toughts?
  21. i know it should be, the problem is that index.php starts like this <?php require_once($_SERVER["DOCUMENT_ROOT"]."/../app.php");
  22. hi, this is kind of weird and is driving me crazy i'm finding at my php_error_log.txt that sometimes there are one of this two errors when calling session_start()sometimes everything is ok, other times i get a Maximum execution time of 30 seconds exceeded in <SERVER>\app.php on line 13 and some other times i get this: but this doesn't seem possible since all my code until the session_start is:<?php /*error_reporting(E_ALL); ini_set('display_errors', '1');*/ //configuracao do header p3p privacy header('P3P:CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT"'); /*header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");*/ //Configuracoes de Sessao session_cache_limiter('none'); session_start(); does anyone have any idea why this might be happening?
  23. yep, use regex to to validate that is numeric.but i would prefer to do do something to prevent the user from even trying to insert anything else, doing something like: $(document).ready( function() { $("#zipcode").keydown(function(event) { // Allow backspace and delete if ( event.keyCode == 46 || event.keyCode == 8 ) { } else { // Ensure that it is a number if (event.keyCode < 48 || event.keyCode > 57 ) { event.preventDefault(); } } });});
  24. if you just want to check the length, assuming your input field id is zipcode function ValidateInput(){ var error = ''; if($('#zipcode).val().length < 6) { error += 'zip code must have 6 digits'; } /*Do here other validations*/ if(error.length >= 1) { alert(error); return false; } else { return true; }} if you also want to validate the format use regular expression, i'am not familiar with U.S. zip code if thats what you're looking for.also if you really want to use only jquery, try checking this jquery validation plugin and the method specified in that website.
  25. Hi, i'm not sure if theis would be the right place to put this, since i've made a few searches on the forum and found nothing on the facebook sdk or plugins subject.Anyway, i hope someone can help me.I'm having this issue for a while now.My login-button is not working correctly on IE (9 version at least), though it works fine on firefox, chrome, opera, safari.First time a user clicks the link it opens the window to allow the permitions and then it gets stuck http://static.ak.fbcdn.net/connect/:)_proxy.php?...Every other time you click the button it just goes to that same page and gets stucked.The integrated login to my page itself never gets performed.There's no error, no warning, no message, no nothing.I already saw a bunch of solutions arround the web that seems to have worked for others but none of them solved my problem.here is part of my code, where the button and fb connection gets called and what to do when loging in through facebook button: (...)<body> <div id="fb-root"></div> (...) <div id="facebookConnect"></div> (...) <script type="text/javascript"> $(document).ready( function() { var loginContent = '<fb:login-button perms="user_birthday,user_location,email" show-faces="false" width="200" max-rows="1"></fb:login-button>'; $("#facebookConnect").html(loginContent); window.fbAsyncInit = function() { FB.init( { appId : facebookAppId, session : facebookSession, // don't refetch the session when PHP already has it status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML } ); FB.Event.subscribe('auth.login', function() { $.getJSON("http://myinc/ajax/loginFacebook.php?callback=?", {}, function(json, status) { if(json.sucesso == true) { (...) } } ); } ); } var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/pt_PT/all.js#xfbml=1"'; e.async = true; document.getElementById('fb-root').appendChild(e); } ); </script>(...) any help anyone can give with this is much apreciated!
  • Create New...