mIRC parsing for a name - parsing

So I've been getting a bothersome someone who keeps using my nickname. What I want to be able to do is perform the following command every time someone with exactly my nickname (let's say UserName) joins the channel I currently reside in:
/msg NickServ ghost UserName n0ideaHwatPassIs?
n0ideaHwatPassIs? is a sample password for our sample registered user of UserName
This sort of script would have to be able to check (in more or less real-time) if a separate user changed his/her nick to said UserName as well. If someone would be so kind as to help me with my dilemma by either pointing me to the proper documentation or working out such a script (no idea if this is as cut-and-dry as I imagined it would be at first) for me?

you can use a on notify event
but first, you have to put that nickname on notify list
type
/notify nickname
then use this script, press alt+r click on file, then new and put this script in there
on *:notify:{
if ($nick != $me) && ($nick == Nickyouwanthere) {
msg NickServ ghost UserName n0ideaHwatPassIs
}

every time someone with exactly my nickname (let's say UserName) joins the channel I currently reside in
This can't happen on IRC. (Except in exceptional circumstances like netsplits, but is immediately resolved then (by dropping one or both parties))

Related

Send Mautic Form to different Recipients based on Formfield

I've a Mautic form with Radiobuttons where the User can select which Department he want to connect with.
o General Question (1)
o Sales (2)
o Technical Support (3)
I want to send the Request to the Person in Charge. So for example:
1: info#company.org
2: sales#company.org
3: support#company.org
I've tried different approaches, but non worked.
The most dirty one was to set the values of the radio buttons as E-Mails and send the Form to the Contact. Worked in some way, but then off course saves the Radiobutton Input to the Database as customer E-Mail. So, only smart in the first place. ;)
I've also tried campaigns, but couldn't find a nice way to use Formfields in the Campaign Templates.
I cannot accept that this couldn't be possible in a easy way. This Form gonna replace a Powermail Form in TYPO3 and there it kind of works like a charm.
Any hint is very much appreciated.
Sorry that you found the documentation bad - we are actually in the process of improving and migrating our developer docs, so please take a look at the WIP docs here: https://mautic-developer.readthedocs.io/en/latest/plugins/getting_started.html which are much improved!
(will also post this on the forum thread!)
After weeks and weeks of research and workarounds I got at the Mautic Form, here is my solution to this Challenge.
I really love Mautic and its extensiveness. It’s just a great and powerful tool.
But at this point it totally misses the market. For me it just feels so wrong and like a big error by design, when you have to create fake fields to handle formfields for such a simple task.
Not talking about the problem when the user overwrite his records before the data being send.
As mentioned this is so easy to do in TYPO3 with Powermail and so I was thinking about creating a plugin, but the documentation on this is really bad.
So here is my solution, as I was looking for simple solution for me as well as the customer.
Solution is tested and worked like a charm for me. Here’s what you can do, for everyone also looking something like this:
Create 1 custom field and label it “Owner (form)” - set Type to Text
Create 2 MySQL Trigger as follows (just copy the code 1:1, should work out of the box):
DELIMITER ;;
CREATE TRIGGER set_lead_owner_from_radiobutton_on_insert BEFORE INSERT ON leads FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
DELIMITER ;;
CREATE TRIGGER set_lead_owner_from_radiobutton_on_update BEFORE UPDATE ON leads FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
Create a form with a Radiobutton or Selectbox and set the “Contact Field” to our custom field “Owner (Form)”
Note: Values of the Radiobuttons / Selectboxes need to be set to the User IDs of your Mautic Instance. So you have to create an user for every Select- oder Radiobutton-Option.
Select for example “Send form results” in Actions and set “Send to owner” to yes.
That’s it.
So what does it do. It’s basically all about the MySQL Triggers. Every time a new Lead is created or updated and our custom field “Owner (form)” is not null and has a valid entry (User ID), the trigger copies the value from our field to the original Owner Field of the lead. So we can then use Owner of the Lead (in my case a Department) to send him a E-Mail.
I hope this is helpfull to someone. But even more I hope that Mautic is gonna fix this in the future, as I believe this a very essential task when it come to enterprise Websites.
Cheers,
Lufi
Mautic Forum Discussion: https://forum.mautic.org/t/send-mautic-form-to-different-recipients-based-on-formfield/24363/13

How to get count of each unique firebase child so only the developer can see (not the user)

I am trying to figure out a way to get a list of each unique child in my Firebase Database & get a count of each unique child.
So for example if somebody entered Amazon 5 times an Hulu 2 times. I want to be able to know that. However, I don't want the user to know this.
I had a few ideas on how to do this.
Idea 1
Use Firebase's:
Answers.logCustomEvent...
However, I see two flaws with this idea.
Flaw 1: This wouldn't be useful for data that has already been entered.
Flaw 2: A user could enter Amason on accident and then changes it later to be the correct Amazon. I would get the incorrect entry..I could log changes but then I'd get bad data...or at least confusing data.
Idea 2
I could write a function inside of the app that could do this, but like I said. I don't need this functionality in the app for the user. I want it so I can know which sites I need to add functionality for first over ones that are seldom entered.
However, is it possible to have 2 apps that use the same database? So the main app is able to read and write data. While I could create a simple app that I wouldn't publish, only really use for myself that could Read the data but not write to it...
I tried to make my Database flat as I knew how..
When a user adds a service it doesn't go under the user node, I have a child called "services" and I just reference that service child in the "user" child.
So my database looks like this
cards
card uid 1
cardname: ""
services
service uid 1: true
services
service uid 1
serviceName: Amazon
serviceUrl: ""
service uid 2
serviceName: Amazon
users
... reference the card this user has access to
So to repeat the question.
I want to be able to know each unique serviceName and if there are duplicates of the same one..how many there are..
I don't need to know who created it or when..
you may have another table where you have objects with only 2 fields: serviceName and count.
So, everytime you have a new instance, you check if it already persists in your table and increment the count value, otherwise create a new row.
Users will not see that info.
And, yes, you can access one database from several apps. Just get clientID, trackingID, etc...

Implementing login for specific users in iOS

I'm creating an app and currently working on the login/sign-up. I found this tutorial (http://www.appcoda.com/login-signup-parse-swift/) but I was wondering if there were a way to accept only certain email addresses? Some pseudocode would be
//Confirm email address if it includes "#collge.KSU.edu"
//saves user info
Well you kind of just answered your question but I guess something like:
Get username from user (or email or whatever)
if(username is valid) {
move to different screen or show notification
}
else {
display pop-up instructing the user their input is not valid
}
The main part is just parsing the String and making sure it is valid which I believe switch is already equip with. So for the case of a specific email, you could try value.contains("#collge.KSU.edu"), of course you'll have to be a bit more careful with using that to make sure they put it in the right spot.

Xtext - Temporarily tolerate unresolvable references and make the reference name user readable

Let's say I have a language that models a part of stackoverflow. Users are held in one resource, questions in another.
Users:
user fred : fred#foobar.com
user notfred : notfred#foobar.com
Questions:
question 123 by fred message "smart question"
question 124 by notfred message "not so smart question"
Now, the user "fred" wants to remove his account, but this wouldn't work because after loading both resources into my ResourceSet I would have a non-empty Resource#getErrors().
I can work around this by filtering XtextLinkingDiagnostic from the errors, but still other users reading the "smart question" cannot tell anymore that it was asked by someone called "fred". The info is still there, I can access it for example when I set a LinkingDiagnosticMessageProvider with LazyLinkingResource#setDiagnosticMessageProvider(...); however, the best thing I can now do is, show other users validation errors that "fred" was deleted, but they wouldn't know "fred" wrote the message they are just reading. Knowing this would help them a lot because everybody knows that "fred" writes great questions, right?
Long story short, I have an application into which users can load a declaration and a definition file. In very few cases something goes wrong and both files don't match perfectly, which means the definition has entries that are not declared in the declaration. However, I know that ~95% of the entries will still match!
Users cannot fix this quickly, but it is likely that they are happy just editing the 95% definitions, but they still need to be able to read the names of the 5% declarations without editing them!
I am not currently using any UI-parts of Xtext to edit the definitions, but rather a custom UI in form of a table. The current state with the missing declarations is that everything except a value column will be empty. The reference ID would be in another column, and knowing this ID would help the user a lot! Is there a clean way to achieve this?
Have a look at the 'Node Model' e.g. org.eclipse.xtext.nodemodel.util.NodeModelUtils.findNodesForFeature(EObject, EStructuralFeature) allows you to access the text that is written in the file

Access Control: Database Fortify

We ran the Fortify scan and had some Access Control: Database issues. The code is getting the textbox value and setting it to a string variable. In this case, it's passing the value from the TextBox to the stored procedure in a database. Any ideas on how I can get around this Access Control: Database issue?
Without proper access control, the method ExecuteNonQuery() in DataBase.cs
can execute a SQL statement on line 320 that contains an attacker-controlled primary
key, thereby allowing the attacker to access unauthorized records.
Source: Tool.ascx.cs:591 System.Web.UI.WebControls.TextBox.get_Text()
rptItem.FindControl("lblClmInvalidEntry").Visible = false;
ToolDataAccess.UpdateToolData(strSDN, strSSNum, strRANC, strAdvRecDate, strAdvSubDate, strClmRecDate, strClmAuth, strClmSubDate, strAdvAuth, txtNoteEntry.Text);
Sink: DataBase.cs:278
System.Data.SqlClient.SqlParameterCollection.Add()
// Add parameters
foreach (SqlParameter parameter in parameters)
cmd.Parameters.Add(parameter);
The point of "Access Control: Database" is where it isn't being specific enough in the query and so could potentially allow a user to see information that they're not supposed to.
An easy example of this vulnerability would be a payroll database where there is a textbox that says the ID of the employee and gives their salary, this could potentially allow the user to change the ID and see the salary of other employees.
Another example where this is often intended functionality is in a website URL where the product ID is used in a parameter, meaning a user could go through every product you have on your site. But as this only allows users to see information they're supposed to be able to, it's not particularly a security issue.
For instance:
"SELECT account_balance FROM accounts WHERE account_number = " + $input_from_attacker + ";"
// even if we safely build the query above, preventing change to the query structure,
// the attacker can still send someone else's account number, and read Grandma's balance!
As this is pretty context based, it's difficult to determine statically so there are lots of examples where Fortify may catch this but it's actually intended functionality. That's not to say the tool is broken, it's just one of the limitations of static analysis and depending on what your program is supposed to be doing it may or may not be intended.
If this is intended to work like this, then I would suggest auditing it as not an issue or suppressing the issue.
If you can see that this is definitely an issue and users can see information that they shouldn't be able to, then the stored procedure needs to be more specific so that users can only see information they should be able to. However SCA will likely still pick this up in a latter scan so you would still then need to audit it as fixed and no longer an issue.

Resources